home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / vdl020d.zip / VWINLOW.DOC < prev    next >
Text File  |  1993-04-14  |  108KB  |  4,856 lines

  1. {
  2.  ════════════════════════════════════════════════════════════════════════════
  3.  
  4.  Visionix Win/User Interface Low-level (VWINLOW)
  5.  Copyright 1991,92,93 Visionix
  6.  ALL RIGHTS RESERVED
  7.  
  8.  ────────────────────────────────────────────────────────────────────────────
  9.  
  10.  Revision history in reverse chronological order:
  11.  
  12.  Initials  Date      Comment
  13.  ────────  ────────  ────────────────────────────────────────────────────────
  14.  
  15.  lpg       03/15/93  Added Source Documentation
  16.  
  17.  mep       02/11/93  Cleaned up code for beta release
  18.                      Changed WSet to use VGen.
  19.                      Changed WColorFromString to not need Ofs.
  20.                      Fixed for DPMI Compiling
  21.  
  22.  jrt       02/08/93  Sync with beta 0.12 release
  23.  
  24.  jrt       02/01/93  Mods to support any screen size VCRT supports
  25.  
  26.  jrt       12/07/92  Sync with beta 0.11 release
  27.  
  28.  jrt       12/02/92  Got rid of local color mapping table; changed border
  29.                      code to work in a more politically-correct fashion.
  30.  
  31.  jrt       11/21/92  Sync with beta 0.08
  32.  
  33.  jrt       09/01/92  First logged revision.
  34.  
  35.  --------------------------------------------------------------------------
  36.  
  37.  Caveats/Known Bugs
  38.  
  39.  
  40.   this unit is under construction!
  41.  
  42.   caveats:  shadow handling???
  43.  
  44.   change checkinvisblebuttons method
  45.   Mouse stuff to use VPoint
  46.  
  47.   WColorFromString to use VColor, along with color mapping
  48.  
  49.   Get rid of WFExist, move to VGen ExistOnPath
  50.  
  51.   look at how memory "behind" WMessage, WInfoMsg is stored
  52.  
  53.   Go over WOpen, create WGetPreOpenInfo
  54.  
  55.   Look at DoBox, ReDoBox, WDoBoxFrame. Make 1 proc w/param???
  56.     also WDrawbox, WBox
  57.  
  58.   Move WSet/GetPalette, WLoadBlueGray/GreenPallete to VCOLOR??
  59.  
  60.   get rid of WFlushKeyBuf, WReadKey, WKeyPressed since we now
  61.     have a VCRT in driver to do all of that.
  62.  
  63.   Get rid of WTextColor WTextBackground, WTextAttr, etc by
  64.     writing a VCRT out driver.
  65.  
  66.  
  67.  ════════════════════════════════════════════════════════════════════════════
  68. }
  69.  
  70. Unit VWinLow;
  71.  
  72.  
  73. Uses
  74.  
  75.   VTypes,
  76.   VGen,
  77.   VMem,
  78.   VMulti,
  79.   VFont,
  80.   VIn,
  81.   VCrt,
  82.   DOS;
  83.  
  84. {────────────────────────────────────────────────────────────────────────────}
  85.  
  86.   {---------------------------------------------------------------}
  87.   { Misc constants which should be moved to different units ASAP. }
  88.   {---------------------------------------------------------------}
  89.  
  90. Const
  91.  
  92.   Key_Exit      = -1;
  93.  
  94.   LBLUE         = 1;
  95.   MBLUE         = 2;
  96.   HBLUE         = 3;
  97.  
  98.   LGRAY         = 5;
  99.   MGRAY         = 6;
  100.   HGRAY         = 7;
  101.  
  102.   {------------------------------------------------------------------}
  103.   { Following is the font data for EGA/VGA redefined check boxes and }
  104.   { radio buttons.  The redefined check boxes and radio buttons use  }
  105.   { a total of 8 characters of the character set.                    }
  106.   { (radio button= 2 chars wide*2 states [on/off])+                  }
  107.   { (check box   = 2 chars wide*2 states [on/off])                   }
  108.   {------------------------------------------------------------------}
  109.  
  110.   FCCBR : Array[0..15] of BYTE =
  111.     ( $00, $00, $FC, $1C, $3C, $74, $E4, $E4,
  112.       $74, $3C, $1C, $FC, $00, $00, $00, $00      );
  113.  
  114.   FCRBL : Array[0..15] of BYTE =
  115.     ( $00, $00, $07, $18, $23, $4F, $4F, $4F,
  116.       $4F, $23, $18, $07, $00, $00, $00, $00      );
  117.  
  118.   FCRBR : Array[0..15] of BYTE =
  119.     ( $00, $00, $C0, $30, $88, $E4, $E4, $E4,
  120.       $E4, $88, $30, $C0, $00, $00, $00, $00      );
  121.  
  122.   FCCBL : Array[0..15] of BYTE =
  123.     ( $00, $00, $1F, $1C, $1E, $17, $13, $13,
  124.       $17, $1E, $1C, $1F, $00, $00, $00, $00      );
  125.  
  126.   FOCBR : Array[0..15] of BYTE =
  127.     ( $00, $00, $FC, $04, $04, $04, $04, $04,
  128.       $04, $04, $04, $FC, $00, $00, $00, $00      );
  129.  
  130.   FOCBL : Array[0..15] of BYTE =
  131.     ( $00, $00, $1F, $10, $10, $10, $10, $10,
  132.       $10, $10, $10, $1F, $00, $00, $00, $00      );
  133.  
  134.   FORBL : Array[0..15] of BYTE =
  135.     ( $00, $00, $07, $18, $20, $40, $40, $40,
  136.       $40, $20, $18, $07, $00, $00, $00, $00      );
  137.  
  138.   FORBR : Array[0..15] of BYTE =
  139.     ( $00, $00, $C0, $30, $08, $04, $04, $04,
  140.       $04, $08, $30, $C0, $00, $00, $00, $00      );
  141.  
  142.   {---------------------------------------------------------------------}
  143.   { Following is the font data for ega/vga redifined border characters. }
  144.   { This border type goes to the outermost edge of the characters, and  }
  145.   { is one pixel wide.                                                  }
  146.   {---------------------------------------------------------------------}
  147.  
  148.   C183_188 : Array[0..95] of BYTE =
  149.     ( $80, $80, $80, $80, $80, $80, $80, $80,
  150.       $80, $80, $80, $80, $80, $80, $80, $80,
  151.       $00, $00, $00, $00, $00, $F8, $18, $F8,
  152.       $18, $18, $18, $18, $18, $18, $18, $18,
  153.       $01, $01, $01, $01, $01, $01, $01, $FF,
  154.       $01, $01, $01, $01, $01, $01, $01, $01,
  155.       $01, $01, $01, $01, $01, $01, $01, $01,
  156.       $01, $01, $01, $01, $01, $01, $01, $01,
  157.       $FF, $01, $01, $01, $01, $01, $01, $01,
  158.       $01, $01, $01, $01, $01, $01, $01, $01,
  159.       $01, $01, $01, $01, $01, $01, $01, $01,
  160.       $01, $01, $01, $01, $01, $01, $01, $FF   );
  161.  
  162.  
  163.   C200_205 : Array[0..95] of BYTE =
  164.     ( $80, $80, $80, $80, $80, $80, $80, $80,
  165.       $80, $80, $80, $80, $80, $80, $80, $FF,
  166.       $FF, $80, $80, $80, $80, $80, $80, $80,
  167.       $80, $80, $80, $80, $80, $80, $80, $80,
  168.       $00, $00, $00, $00, $00, $00, $00, $00,
  169.       $00, $00, $00, $00, $00, $00, $00, $01,
  170.       $01, $00, $00, $00, $00, $00, $00, $00,
  171.       $00, $00, $00, $00, $00, $00, $00, $00,
  172.       $FF, $00, $00, $00, $00, $00, $00, $00,
  173.       $00, $00, $00, $00, $00, $00, $00, $00,
  174.       $00, $00, $00, $00, $00, $00, $00, $00,
  175.       $00, $00, $00, $00, $00, $00, $00, $FF   );
  176.  
  177.   C224_250  : Array[0..431] of BYTE =
  178.     ( $FF, $81, $99, $99, $99, $99, $99, $99,
  179.       $99, $99, $BD, $99, $81, $FF, $00, $00,
  180.       $80, $00, $00, $00, $00, $00, $00, $00,
  181.       $00, $00, $00, $00, $00, $00, $00, $00,
  182.       $00, $00, $00, $00, $00, $00, $00, $00,
  183.       $00, $00, $00, $00, $00, $00, $00, $80,
  184.       $00, $1F, $10, $13, $10, $10, $10, $10,
  185.       $10, $10, $10, $10, $1F, $0F, $00, $00,
  186.       $00, $FF, $00, $00, $00, $00, $55, $00,
  187.       $55, $00, $00, $00, $FF, $FF, $00, $00,
  188.       $00, $FF, $00, $00, $00, $00, $54, $00,
  189.       $54, $00, $00, $00, $FF, $FF, $00, $00,
  190.       $00, $C0, $60, $60, $60, $60, $60, $60,
  191.       $60, $60, $60, $60, $E0, $E0, $00, $00,
  192.       $00, $FF, $00, $00, $00, $FF, $00, $00,
  193.       $01, $01, $D0, $00, $FF, $FF, $00, $00,
  194.       $00, $FF, $00, $00, $00, $FE, $00, $DC,
  195.       $12, $12, $DC, $00, $FF, $FF, $00, $00,
  196.       $00, $FF, $00, $00, $00, $00, $0F, $FF,
  197.       $0F, $00, $00, $00, $FF, $FF, $00, $00,
  198.       $00, $FF, $00, $00, $00, $00, $C0, $FC,
  199.       $C0, $00, $00, $00, $FF, $FF, $00, $00,
  200.       $00, $FF, $00, $00, $00, $8B, $CA, $AB,
  201.       $9A, $8B, $00, $00, $FF, $FF, $00, $00,
  202.       $00, $FF, $00, $00, $00, $DF, $04, $84,
  203.       $04, $C4, $00, $00, $FF, $FF, $00, $00,
  204.       $FF, $80, $80, $81, $83, $87, $8F, $9F,
  205.       $81, $81, $81, $81, $81, $80, $80, $FF,
  206.       $FF, $01, $01, $81, $C1, $E1, $F1, $F9,
  207.       $81, $81, $81, $81, $81, $01, $01, $FF,
  208.       $FF, $80, $80, $81, $81, $81, $81, $81,
  209.       $9F, $8F, $87, $83, $81, $80, $80, $FF,
  210.       $FF, $01, $01, $81, $81, $81, $81, $81,
  211.       $F9, $F1, $E1, $C1, $81, $01, $01, $FF,
  212.       $00, $00, $0F, $30, $20, $7F, $80, $40,
  213.       $40, $20, $20, $10, $0F, $00, $00, $00,
  214.       $00, $00, $80, $7C, $02, $C2, $22, $12,
  215.       $12, $0A, $0A, $06, $FE, $00, $00, $00,
  216.       $00, $00, $7F, $40, $5B, $40, $55, $40,
  217.       $56, $40, $5D, $40, $40, $7F, $00, $00,
  218.       $00, $00, $E0, $50, $48, $44, $7C, $04,
  219.       $D4, $04, $B4, $04, $04, $FC, $00, $00,
  220.       $00, $00, $7F, $40, $40, $7F, $40, $40,
  221.       $40, $40, $40, $40, $40, $7F, $00, $00,
  222.       $00, $00, $FC, $04, $04, $FC, $04, $04,
  223.       $04, $04, $04, $04, $04, $FC, $00, $00,
  224.       $00, $1F, $17, $10, $10, $10, $10, $10,
  225.       $10, $10, $14, $10, $1F, $0F, $00, $00,
  226.       $00, $E0, $DF, $0F, $00, $70, $88, $88,
  227.       $70, $00, $00, $00, $FF, $FF, $00, $00,
  228.       $00, $00, $00, $00, $00, $00, $18, $18,
  229.       $00, $00, $00, $00, $00, $00, $00, $00,
  230.       $00, $3F, $DF, $80, $00, $70, $88, $88,
  231.       $70, $00, $01, $00, $FF, $FF, $00, $00     );
  232.  
  233.   {-------------------------------------------------------------------------
  234.  
  235.   Window flags:
  236.  
  237.   65536   15
  238.   32768   14
  239.   16384   13 Active Border
  240.   8192    12 Locked Shadow
  241.  
  242.   4096    11 \   Shadow Type:
  243.   2048    10  >     00=none, 01=half char, 02=reserved
  244.   1024    09 /      03=double vert+double horiz attrib
  245.  
  246.   512     08 \_ Vertical Scroll Bar Style:
  247.   256     07 /    00=none, 01=1 char wide, 02=2 char wide, 03=reserved
  248.  
  249.   128     06 \_ Horizontal Scroll Bar Style:
  250.   64      05 /    00=none, 01=1 char high, 02=2 char high, 03=reserved
  251.  
  252.   32      04 reserved
  253.   16      03 HasCloseBox
  254.  
  255.   8       03 reserved
  256.   4       02 HasSizeBox
  257.  
  258.   2       01 \_ Title Style:
  259.   1       00 /    00=none, 01=left, 02=centered, 03=right
  260.  
  261.   -------------------------------------------------------------------------}
  262.  
  263.   cwnShadow   = 1;
  264.   cwnlockshadow = 2;
  265.   cwnactivebord = 4;
  266.  
  267.   fwTitleHidden  = 0;
  268.   fwTitleLeft    = 1;
  269.   fwTitleCenter  = 2;
  270.   fwTitleRight   = 3;
  271.  
  272.   fwSizeBox      = 4;
  273.  
  274.   fwHasCloseBox  = 16;
  275.  
  276.   fwHSBNone      = 0;
  277.   fwHSB1Char     = 64;
  278.   fwHSB2Char     = 128;
  279.  
  280.   fwVSBNone      = 0;
  281.   fwVSB1Char     = 256;
  282.   fwVSB2Char     = 512;
  283.  
  284.   fwShadowNone   = 0;
  285.   fwShadowHalf   = 1024;
  286.   fwShadowAlt    = 2048;
  287.   fwShadow       = 1024+2048;
  288.  
  289.   fwShadowLocked = 8192;
  290.   fwActiveBorder = 16384;
  291.  
  292.   {-----------------------------------------------------------------}
  293.   { Window border types and constants.  This section is currently   }
  294.   { being reworked, and that is why there are so many commented out }
  295.   { constants and such.                                             }
  296.   {-----------------------------------------------------------------}
  297.  
  298.   {------------------------------------------------------------------
  299.  
  300.    Border Attribute word:
  301.  
  302.    64 07 reserved
  303.    32 06 \_ Vertical Scroll Bar indicator style
  304.    16 05 /   00=use cahrs, 01=use border color
  305.  
  306.     8 04 \_ Horizontal Scroll Bar indicator Style
  307.     4 03 /    00=use chars, 01=use border color
  308.  
  309.     2 02 \_ Border Color Style:
  310.     1 01 /    00=use bordcolor for all
  311.               01=use bordcolor for top line, wincolor for rest
  312.               02= reserved
  313.               03= reserved
  314.  
  315.   ------------------------------------------------------------------}
  316.  
  317.   fwbUseBorderColorForAll    = 00;
  318.   fwbUseBorderColorForTop    = 01;
  319.  
  320.   fwbHSBUseCharsForIndicator = 4;
  321.   fwbHSBUseColorForIndicator = 8;
  322.  
  323.   fwbVSBUseCharsForIndicator = 16;
  324.   fwbVSBUseColorForIndicator = 32;
  325.  
  326.   cwbTitleLeft = 1;
  327.   cwbColorStyleAll  = 2;
  328.   cwbColorStyleTop  = 4;
  329.  
  330. Type
  331.  
  332.   {------------------------------------------------------------------}
  333.   { Button and button list defintions.  This applies to push-buttons }
  334.   { only.  Button lists are simply an array of TButton.              }
  335.   {------------------------------------------------------------------}
  336.  
  337.   TButton = Record
  338.  
  339.     BType : BYTE;
  340.     X     : BYTE;
  341.     Y     : BYTE;
  342.     FC    : INTEGER;
  343.     BC    : INTEGER;
  344.     Text  : ST80;
  345.  
  346.   END;
  347.  
  348.   TButtonList4 = ARRAY[1..4 ] of TButton;
  349.   TButtonList  = ARRAY[1..20] of TButton;
  350.   PButtonList  = ^TButtonList;
  351.  
  352.  
  353.   {------------------------------------------------------------------}
  354.   { "Menu" definitions.  Menus are arrays of STRING[80] (or ST80s).  }
  355.   {------------------------------------------------------------------}
  356.  
  357.   TMenu     = Array[1..26 ] of ST80;
  358.   TMenu50   = Array[1..50 ] of ST80;
  359.   TMenu100  = Array[1..100] of ST80;
  360.   TMenuMax  = Array[1..100] of ST80;
  361.  
  362.   PMenu     = ^TMenu;
  363.   PMenu50   = ^TMenu50;
  364.   PMenu100  = ^TMenu100;
  365.   PMenuMax  = ^TMenuMax;
  366.  
  367.   {-----------------------------------------------------------------}
  368.   { Screen records.  These records define a cell of display console }
  369.   { memory and an entire screen of display console memory.          }
  370.   {-----------------------------------------------------------------}
  371.  
  372.   TScreenCell = Record
  373.  
  374.     Ch : CHAR;
  375.     At : BYTE;
  376.  
  377.   END;
  378.  
  379.   TScreen = Array[1..50,1..80] of TScreenCell;
  380.   PScreen = ^TScreen;
  381.  
  382.   {--------------------------------------------------------------}
  383.   { Region store record.  A region store is a record that stores }
  384.   { a rectangular portion of the display console.                }
  385.   {--------------------------------------------------------------}
  386.  
  387.   TRegionStore = RECORD
  388.  
  389.     X1    : INTEGER;
  390.     Y1    : INTEGER;
  391.     X2    : INTEGER;
  392.     Y2    : INTEGER;
  393.  
  394.     SMH   : THandle;      { Store memory handle }
  395.  
  396.   END;
  397.  
  398.   PRegionStore = ^TRegionStore;
  399.  
  400.   {----------------------------------------------------------------}
  401.   { Frame Joint record.  A frame joint is a point on the border of }
  402.   { the window which should be a "joint" to connect to a line that }
  403.   { is in the interior of the window.                              }
  404.   {----------------------------------------------------------------}
  405.  
  406.   TFrameJoint = Record
  407.  
  408.     Side   : BYTE;
  409.     Offset : BYTE;
  410.  
  411.   END;
  412.  
  413.   {-------------------------------------------------------------}
  414.   { Screen Stack node record.  The screen stack is used for the }
  415.   { WPushScreen and WPopScreen commands.                        }
  416.   {-------------------------------------------------------------}
  417.  
  418.   PScreenStack = ^TScreenStack;
  419.  
  420.   TScreenStack = Record
  421.  
  422.     RS       : PRegionStore;
  423.  
  424.     CursorX  : BYTE;
  425.     CursorY  : BYTE;
  426.     CAttr    : BYTE;
  427.     Next     : PScreenStack;
  428.  
  429.   END;
  430.  
  431.   {-------------------------------------}
  432.   { Window managers color mapping table }
  433.   {-------------------------------------}
  434.  
  435.   TColorMap = ARRAY[0..255] of BYTE;
  436.  
  437.   {---------------------------------------------}
  438.   { Window manager internal register structure. }
  439.   {---------------------------------------------}
  440.  
  441.   TWIntRegisters = Record
  442.  
  443.     Case BYTE of
  444.  
  445.       1 : ( BP, ES, DS, DI, SI, DX, CX, BX, AX, IP, CS, Flags : WORD );
  446.       2 : ( Dummy : ARRAY[1..5] of WORD;
  447.             DL, DH, CL, CH, BL, BH, AL, AH : BYTE );
  448.  
  449.   END;
  450.  
  451.   {--------------------------------------------------------------}
  452.   { Window Event Procedure types and constants.  A windows event }
  453.   { procedure is called any time an event happens in/to the      }
  454.   { specific window.                                             }
  455.   {--------------------------------------------------------------}
  456.  
  457.   TWinEvent = RECORD
  458.  
  459.     Category    : WORD;
  460.     Code        : WORD;
  461.     Data1       : LONGINT;
  462.     Data2       : LONGINT;
  463.     Data3       : LONGINT;
  464.     Data4       : LONGINT;
  465.     Pointer1    : POINTER;
  466.     Pointer2    : POINTER;
  467.     Pointer3    : POINTER;
  468.     Pointer4    : POINTER;
  469.  
  470.   END;
  471.  
  472.   PWinEvent = ^TWinEvent;
  473.  
  474.   {----}
  475.  
  476.   PWin = ^TWin;
  477.  
  478.   TWinEventProc = Procedure(    Win    : PWin;
  479.                                 Event  : TWinEvent  );
  480.  
  481.   {-----------------------------------------------------------}
  482.   { Window record.  One of this is created and maintained for }
  483.   { each window.  They are maintained as a double-linked list }
  484.   { which is in the order that the windows are "stacked" on   }
  485.   { the screen.                                               }
  486.   {-----------------------------------------------------------}
  487.  
  488.   TWin = Record
  489.  
  490.     Name             : ST80;          { name of the window }
  491.  
  492.     BorderX          : BYTE;          { Coords of the outside window edge }
  493.     BorderY          : BYTE;
  494.     BorderX2         : BYTE;
  495.     BorderY2         : BYTE;
  496.  
  497.     X                : BYTE;          { coords of the inner window }
  498.     Y                : BYTE;
  499.     X2               : BYTE;
  500.     Y2               : BYTE;
  501.  
  502.     BorderFC         : BYTE;          { Border colors  }
  503.     BorderBC         : BYTE;
  504.  
  505.     FC               : BYTE;          { inner window colors }
  506.     BC               : BYTE;
  507.  
  508.     CursorX          : BYTE;          { cursor x and Y }
  509.     CursorY          : BYTE;
  510.  
  511.     FS               : PRegionStore;  { "front" store }
  512.     BS               : PRegionStore;  { "Back" store  }
  513.  
  514.     YShadowSave      : ARRAY[1..80] of TScreenCell; { shadow stores }
  515.     XShadowSav1      : ARRAY[1..50] of TScreenCell;
  516.     XShadowSav2      : ARRAY[1..50] of TScreenCell;
  517.  
  518.     LastTextAttr     : BYTE;          { text attribute }
  519.  
  520.     HasShadow        : BOOLEAN;       { TRUE if window has a shadow }
  521.     ShadowLock       : BOOLEAN;       { TRUE if the shadow is locked on }
  522.     Hidden           : BOOLEAN;       { TRUE if the window is hidden }
  523.  
  524.     BorderNum        : WORD;          { Border number window uses }
  525.  
  526.     BorderProc       : POINTER;       { Pointer to custom bord proc }
  527.  
  528.     FrameJoint       : ARRAY[1..20] of TFrameJoint; {Frame-joint info }
  529.  
  530.     EventProc        : TWinEventProc; { Pointer to event procedure }
  531.  
  532.     Prev             : PWin;          { Pointer to previous window rec }
  533.     Next             : PWin;          { Pointer to next     window rec }
  534.  
  535.   END;
  536.  
  537.   TBorder = Record
  538.  
  539.     UL    : CHAR;
  540.     UR    : CHAR;
  541.     BL    : CHAR;
  542.     BR    : CHAR;
  543.     HU    : CHAR;
  544.     HL    : CHAR;
  545.     VL    : CHAR;
  546.     VR    : CHAR;
  547.     NL    : CHAR;
  548.     NR    : CHAR;
  549.     BF1   : CHAR;
  550.     BF2   : CHAR;
  551.     BF3   : CHAR;
  552.     BF4   : CHAR;
  553.     BF11  : CHAR;
  554.     BF12  : CHAR;
  555.     BF13  : CHAR;
  556.     BF14  : CHAR;
  557.     Hline : ARRAY[1..2] of CHAR;
  558.     VLine : ARRAY[1..2] of CHAR;
  559.  
  560.   END;
  561.  
  562.   PBorder = ^TBorder;
  563.  
  564.   {----------------------------------------------------------------}
  565.   { Window manager environment.  This is the record that maintains }
  566.   { all the information about the current status of the window     }
  567.   { manager.  It is created when the window manager is opened.     }
  568.   {----------------------------------------------------------------}
  569.  
  570.   TWinEnv = Record
  571.  
  572.     Look           : BYTE;
  573.  
  574.     ProgramName    : ST80;
  575.  
  576.     CurWin         : PWin;
  577.  
  578.     LastCol        : INTEGER;
  579.     LastRow        : INTEGER;
  580.     CenterCol      : INTEGER;
  581.     CenterRow      : INTEGER;
  582.     OrigMode       : INTEGER;
  583.     HiRez          : BOOLEAN;
  584.     SuperRez       : BOOLEAN;
  585.  
  586.     NoActive       : BOOLEAN;
  587.  
  588.     CursorOn       : BOOLEAN;
  589.     CursorBig      : BOOLEAN;
  590.  
  591.     Shadow         : BOOLEAN;
  592.  
  593.     KeepScreen     : BOOLEAN;
  594.  
  595.     MActive        : BOOLEAN;
  596.     MPointerOn     : BOOLEAN;
  597.  
  598.     Recording      : BOOLEAN;
  599.     Playing        : BOOLEAN;
  600.  
  601.     BW             : BOOLEAN;
  602.     Mono           : BOOLEAN;
  603.  
  604.     Clock          : BOOLEAN;
  605.  
  606.     Events         : BOOLEAN;
  607.  
  608.     ShowFreeMem    : BOOLEAN;
  609.  
  610.     ShadowLock     : BOOLEAN;
  611.  
  612.     SaveScreenContents : BOOLEAN;
  613.  
  614.     WNewFlags      : LONGINT;
  615.  
  616.     PlayDelay      : INTEGER;
  617.  
  618.     Border         : INTEGER;
  619.  
  620.     KHits          : BYTE;
  621.  
  622.     InitChar       : ST80;
  623.  
  624.     LeftButton     : CHAR;
  625.     RightButton    : CHAR;
  626.  
  627.     InitTxtC       : INTEGER;
  628.     InitBckC       : INTEGER;
  629.  
  630.     Help           : INTEGER;
  631.     HelpPage       : INTEGER;
  632.     HelpFile       : ST80;
  633.     HelpProc       : POINTER;
  634.  
  635.  
  636.     MessageBack    : STRING;
  637.     InfoMsgBack    : STRING;
  638.  
  639.  
  640.     NumPrgs        : BYTE;
  641.     NumPrompts     : BYTE;
  642.     NumInfos       : BYTE;
  643.     NumMsgs        : BYTE;
  644.  
  645.     PrgButtons     : TButtonList4;
  646.     PromptButtons  : TButtonList4;
  647.     InfoButtons    : TButtonList4;
  648.     MsgButtons     : TButtonList4;
  649.  
  650.     MsgLineStyle   : BYTE;
  651.  
  652.     {----}
  653.  
  654.     PreInit : Record
  655.  
  656.       X            : BYTE;
  657.       Y            : BYTE;
  658.       TextAttr     : BYTE;
  659.       RS           : PRegionStore;
  660.  
  661.     END;
  662.  
  663.     {----}
  664.  
  665.     KeyRecChan     : TEXT;
  666.     KeyRecFileName : ST80;
  667.  
  668.     CursorX        : BYTE;
  669.     CursorY        : BYTE;
  670.     CurAttr        : BYTE;
  671.     CurTextColor   : BYTE;
  672.     CurBackColor   : BYTE;
  673.  
  674.     KeyBuff        : STRING;
  675.  
  676.     DialogNum      : INTEGER;
  677.     TopLeftNum     : BYTE;
  678.  
  679.     MenuLineColor  : BYTE;
  680.     MenuLineColorF : BYTE;
  681.  
  682.     GemIconColor   : BYTE;
  683.     GemFore        : BYTE;
  684.     GemBack        : BYTE;
  685.     GemHFore       : BYTE;
  686.     GemHBack       : BYTE;
  687.     GemNFore       : BYTE;
  688.     GemNBack       : BYTE;
  689.     GemBPlace      : BYTE;
  690.     GemButtonType  : BYTE;
  691.     GemHButtonType : BYTE;
  692.     GemMinBSize    : BYTE;
  693.  
  694.     EventKey       : BYTE;
  695.     EventExtKey    : BYTE;
  696.     EventButtons   : BYTE;
  697.  
  698.     TopLineFore    : BYTE;
  699.     TopLineBack    : BYTE;
  700.  
  701.     TimerProc      : POINTER;
  702.  
  703.     MouseType      : BYTE;
  704.  
  705.     WidgetFontOn   : BOOLEAN;
  706.  
  707.   END;
  708.  
  709.   {----}
  710.  
  711.   PWinEnvStack=^TWinEnvStack;
  712.  
  713.   TWinEnvStack=Record
  714.  
  715.     Info : TWinEnv;
  716.     Next : PWinEnvStack;
  717.  
  718.   END;
  719.  
  720. {────────────────────────────────────────────────────────────────────────────}
  721.  
  722. Procedure WRegionStoreWrite(      RS             : PRegionStore );
  723.  
  724. Procedure WTextColor(             Color          : INTEGER      );
  725.  
  726. Procedure WTextBackGround(        Color          : INTEGER      );
  727.  
  728. Procedure WTextColors(            FC             : INTEGER;
  729.                                   BC             : INTEGER      );
  730.  
  731. Procedure WTextAttr(              Attr           : BYTE         );
  732.  
  733.  
  734. Function  WOnWinEdge(             TheWin         : PWin;
  735.                                   X              : INTEGER;
  736.                                   Y              : INTEGER      ) : BOOLEAN;
  737.  
  738. Procedure WError(                 Error          : ST80         );
  739.  
  740. Function  WColorFromString(       S              : STRING       ) : BYTE;
  741.  
  742. Function  WReadButtonListRel(     Blist          : PButtonList;
  743.                                   X              : INTEGER;
  744.                                   Y              : INTEGER;
  745.                                   Count          : BYTE         ) : INTEGER;
  746.  
  747. Function  WReadButtonList(        BList          : PButtonList;
  748.                                   Count          : BYTE         ) : INTEGER;
  749.  
  750. Function  WSReadButtonList(       BList          : PButtonList;
  751.                                   Count          : BYTE         ) : INTEGER;
  752.  
  753. Function  WKeyPressed                                             : BOOLEAN;
  754.  
  755. Function  WIDoReadKey                                             : CHAR;
  756.  
  757. Procedure WCursorOn;
  758.  
  759. Procedure WCursorOff;
  760.  
  761. Procedure WCursorBig;
  762.  
  763. Procedure WCursorSmall;
  764.  
  765. Procedure WMPointerOn;
  766.  
  767. Procedure WMPointerOff;
  768.  
  769. Procedure WMGetStatus(        Var Buttons        : INTEGER;
  770.                               Var X              : INTEGER;
  771.                               Var Y              : INTEGER   );
  772.  
  773. Procedure WMWaitForNoButtons;
  774.  
  775. Procedure WBackRefresh(           S              : STRING;
  776.                                   FC             : BYTE;
  777.                                   BC             : BYTE      );
  778.  
  779. Procedure WSet(                   S              : ST80      );
  780.  
  781. Procedure WOpen(                  BackGroundCH   : ST80;
  782.                                   TxtColor       : BYTE;
  783.                                   BckColor       : BYTE;
  784.                                   S              : ST80      );
  785.  
  786. Procedure WClear(                 X              : INTEGER;
  787.                                   Y              : INTEGER;
  788.                                   X2             : INTEGER;
  789.                                   Y2             : INTEGER;
  790.                                   FC             : INTEGER;
  791.                                   BC             : INTEGER   );
  792.  
  793. Procedure WNew(                   X              : INTEGER;
  794.                                   Y              : INTEGER;
  795.                                   X2             : INTEGER;
  796.                                   Y2             : INTEGER;
  797.                                   FC             : BYTE;
  798.                                   BC             : BYTE;
  799.                                   BorderFC       : BYTE;
  800.                                   BorderBC       : BYTE;
  801.                                   Name           : ST80      );
  802.  
  803. Procedure WEnter(                 Name           : ST80      );
  804.  
  805. Procedure WExit;
  806.  
  807. Procedure WGo(                    Name           : ST80      );
  808.  
  809. Procedure WDispose(               Name           : ST80      );
  810.  
  811. Procedure WPopEnv;
  812.  
  813. Procedure WPushEnv;
  814.  
  815. Procedure WSubmitBorder(          X              : INTEGER;
  816.                                   S              : ST80;
  817.                                   SBIFore        : BYTE;
  818.                                   SBIBack        : BYTE;
  819.                                   Attr           : LONGINT   );
  820.  
  821. Procedure WDoBoxFrame(            TheWin         : PWin      );
  822.  
  823. Procedure WSubmitFrameJoint(      Num            : INTEGER;
  824.                                   Side           : INTEGER;
  825.                                   Offset         : INTEGER   );
  826.  
  827. Procedure WPopScreen;
  828.  
  829. procedure WShowFreeMem;
  830.  
  831. Procedure WMTShowFreeMem(         NewProc        : BOOLEAN   );
  832.  
  833. Procedure WPushScreen;
  834.  
  835. Procedure WHideUnHide(            Name           : ST80;
  836.                                   HideWin        : BOOLEAN   );
  837.  
  838. Function  WFExist(                FName          : STRING    ) : BOOLEAN;
  839.  
  840. Procedure WGoCurrentWin;
  841.  
  842. Function  WGetWinPointer(         Name           : ST80      ) : THandle;
  843.  
  844. Procedure WDrawShadowOn(          P              : PWin      );
  845.  
  846. Procedure WEraseShadowFrom(       P              : PWin      );
  847.  
  848. Procedure WFastWrite(             X              : INTEGER;
  849.                                   Y              : INTEGER;
  850.                                   FC             : BYTE;
  851.                                   BC             : BYTE;
  852.                                   S              : STRING    );
  853.  
  854. Procedure WSFastWrite(            X              : INTEGER;
  855.                                   Y              : INTEGER;
  856.                                   FC             : BYTE;
  857.                                   BC             : BYTE;
  858.                                   S              : STRING    );
  859.  
  860. Procedure WTSR_Entry;
  861.  
  862. Procedure WSetHasShadow(          Name           : ST80;
  863.                                   Bool           : BOOLEAN   );
  864.  
  865. Procedure WFlushKeyBuf;
  866.  
  867. Procedure WRename(                OrigName       : ST80;
  868.                                   NewName        : ST80      );
  869.  
  870. Procedure WLoadWidgetFont;
  871.  
  872. Procedure WLoadLook1BorderFont;
  873.  
  874. Procedure WSetPalette(            PalNum,
  875.                                   R, G, B        : BYTE      );
  876.  
  877. Procedure WGetPalette(            PalNum         : BYTE;
  878.                               Var R, G, B        : BYTE      );
  879.  
  880.  
  881. Procedure WLoadBlueGrayPalette;
  882.  
  883. Procedure WLoadGreenGrayPalette;
  884.  
  885. Procedure WDrawBox(               X, Y, X2, Y2,
  886.                                   F, B, Style    : INTEGER   );
  887.  
  888. Procedure WBox(                   X, Y, X2, Y2,
  889.                                   Style          : INTEGER   );
  890.  
  891. Procedure WEventsOn;
  892.  
  893. Procedure WEventsOff;
  894.  
  895. {────────────────────────────────────────────────────────────────────────────}
  896.  
  897. Var
  898.  
  899.   WinEnv      : TWinEnv;
  900.  
  901.   NilWin      : PWin;
  902.  
  903.   M_Vid_Mem   : PScreen;
  904.   C_Vid_Mem   : PScreen;
  905.   Vid_Mem     : PScreen;
  906.   ColorTable  : ARRAY[0..255] of INTEGER;
  907.  
  908.   WinStack    : PWin;
  909.  
  910.   WinEnvStack : PWinEnvStack;
  911.  
  912.   ScreenStack : PScreenStack;
  913.  
  914.   VidWidth    : WORD;
  915.   BaseAddr    : WORD;
  916.   Border      : ARRAY[1..10] of TBorder;
  917.   ColorMap    : TColorMap;
  918.   WrLastSec   : WORD;
  919.  
  920. {────────────────────────────────────────────────────────────────────────────}
  921.  
  922.  
  923. ──────────────────────────────────────────────────────────────────────────────
  924.  
  925.  
  926. [FUNCTION]
  927.  
  928. Procedure WFastWrite(             X              : INTEGER;
  929.                                   Y              : INTEGER;
  930.                                   FC             : BYTE;
  931.                                   BC             : BYTE;
  932.                                   S              : STRING       );
  933.  
  934. [PARAMETERS]
  935.  
  936. X           Starting X Window Coordinate for Text (Base 1)
  937. Y           Starting Y Window Coordinate for Text (Base 1)
  938. FC          Text Foreground Color
  939. BC          Text Background Color
  940. S           Text String to Write
  941.  
  942. [RETURNS]
  943.  
  944. (None)
  945.  
  946. [DESCRIPTION]
  947.  
  948. Optimized routine to output a string to the provided Window Coordinates
  949. in the given colors.  Use WSFastWrite if you wish the Text to be written
  950. relative to the Full Screen.
  951.  
  952. [SEE-ALSO]
  953.  
  954. WSFastWrite
  955.  
  956. [EXAMPLE]
  957.  
  958. BEGIN
  959.  
  960.   WNew( 5,2,30,7, WHITE,CYAN,WHITE,CYAN, 'Window' );
  961.  
  962.   WFastWrite( 2,3, BLUE,CYAN, 'Sample Window Text' );
  963.  
  964.   While NOT WKeyPressed Do;
  965.   WDispose( 'Window' );
  966.  
  967. END;
  968.  
  969.  
  970. ──────────────────────────────────────────────────────────────────────────────
  971.  
  972.  
  973. [FUNCTION]
  974.  
  975. Procedure WSFastWrite(            X              : INTEGER;
  976.                                   Y              : INTEGER;
  977.                                   FC             : BYTE;
  978.                                   BC             : BYTE;
  979.                                   S              : STRING       );
  980.  
  981. [PARAMETERS]
  982.  
  983. X           Starting X Screen Coordinate for Text
  984. Y           Starting Y Screen Coordinate for Text
  985. FC          Text Foreground Color
  986. BC          Text Background Color
  987. S           Text String to Write
  988.  
  989. [RETURNS]
  990.  
  991. (None)
  992.  
  993. [DESCRIPTION]
  994.  
  995. Optimized routine to output a string to the provided Screen coordinates
  996. in the given colors.  Use WFastWrite if you wish the Text to be written
  997. relative to the current Window.
  998.  
  999. [SEE-ALSO]
  1000.  
  1001. WFastWrite
  1002.  
  1003. [EXAMPLE]
  1004.  
  1005. BEGIN
  1006.  
  1007.   WSFastWrite( 30,10, WHITE,RED, 'Sample Screen Text' );
  1008.  
  1009. END;
  1010.  
  1011.  
  1012. ──────────────────────────────────────────────────────────────────────────────
  1013.  
  1014.  
  1015. [FUNCTION]
  1016.  
  1017. Procedure WShowFreeMem;
  1018.  
  1019. [PARAMETERS]
  1020.  
  1021. (None)
  1022.  
  1023. [RETURNS]
  1024.  
  1025. (None)
  1026.  
  1027. [DESCRIPTION]
  1028.  
  1029. This function displays the current Free Memory and Max Memory on the
  1030. Program Title bar.  This is mainly intended as a Programmer's Debugging
  1031. tool in determining when memory is not properly being allocated or
  1032. deallocated.
  1033.  
  1034. [SEE-ALSO]
  1035.  
  1036. ShowFreeMemMultiProc
  1037. WMTShowFreeMem
  1038.  
  1039. [EXAMPLE]
  1040.  
  1041. VAR
  1042.   ch : CHAR;
  1043.  
  1044. BEGIN
  1045.  
  1046.   WShowFreeMem;
  1047.  
  1048.   WMessage( 'Press a Key and watch the Memory Usage', WHITE,CYAN );
  1049.   ch := WReadKey;
  1050.   WNew( 5,2,30,7, WHITE,CYAN,WHITE,CYAN, 'Window' );
  1051.   WShowFreeMem;
  1052.  
  1053.   WMessage( 'Press another Key and Keep an eye on the Memory', WHITE,CYAN );
  1054.   ch := WReadKey
  1055.   WDispose( 'Window' );
  1056.   WShowFreeMem;
  1057.  
  1058.   WMessage( 'Press any key to Quit', WHITE,CYAN );
  1059.   While NOT WKeyPressed Do;
  1060.  
  1061. END;
  1062.  
  1063.  
  1064. ──────────────────────────────────────────────────────────────────────────────
  1065.  
  1066.  
  1067. [FUNCTION]
  1068.  
  1069. Procedure ShowFreeMemMultiProc(   Status         : BYTE;
  1070.                               Var IData          : POINTER      ); Far;
  1071.  
  1072. [PARAMETERS]
  1073.  
  1074. Status      ?
  1075. IData       ?
  1076.  
  1077. [RETURNS]
  1078.  
  1079. [DESCRIPTION]
  1080.  
  1081. This is the Multi-Tasking Procedure which Keeps the Screen display
  1082. updated about the current Free Memory.  It is Very Low-Level and
  1083. should be allowed to load through the WMTShowFreeMem Procedure call.
  1084.  
  1085. [SEE-ALSO]
  1086.  
  1087. WShowFreeMem
  1088. WMTShowFreeMem
  1089.  
  1090. [EXAMPLE]
  1091.  
  1092.  
  1093. ──────────────────────────────────────────────────────────────────────────────
  1094.  
  1095.  
  1096. [FUNCTION]
  1097.  
  1098. Procedure WMTShowFreeMem(         NewProc        : BOOLEAN      );
  1099.  
  1100. [PARAMETERS]
  1101.  
  1102. NewProc     If this is the First Time This Procedure was Loaded?
  1103.  
  1104. [RETURNS]
  1105.  
  1106. (None)
  1107.  
  1108. [DESCRIPTION]
  1109.  
  1110. Installs the Multi-Tasking Free Memory Display Procedure.  From this
  1111. point forward, the free memory will be constantly updated in real-time
  1112. on the fist line of the screen.
  1113.  
  1114. The main purpose of this routine was for debugging memory allocation,
  1115. usage and deallocation (making sure you release it all!).  It is an
  1116. extremely useful debugging tools.
  1117.  
  1118. It cannot be unloaded except by restarting the program.
  1119.  
  1120. [SEE-ALSO]
  1121.  
  1122. WShowFreeMem
  1123. ShowFreeMemMultiProc
  1124.  
  1125. [EXAMPLE]
  1126.  
  1127. VAR
  1128.   ch : CHAR;
  1129.  
  1130. BEGIN
  1131.  
  1132.   WMTShowFreeMem;
  1133.  
  1134.   WMessage( 'Press a Key and watch the Memory Usage', WHITE,CYAN );
  1135.   ch := WReadKey;
  1136.   WNew( 5,2,30,7, WHITE,CYAN,WHITE,CYAN, 'Window' );
  1137.  
  1138.   WMessage( 'Press another Key and Keep an eye on the Memory', WHITE,CYAN );
  1139.   ch := WReadKey
  1140.   WDispose( 'Window' );
  1141.  
  1142.   WMessage( 'Press any key to Quit', WHITE,CYAN );
  1143.   While NOT WKeyPressed Do;
  1144.  
  1145. END;
  1146.  
  1147.  
  1148.  
  1149. ──────────────────────────────────────────────────────────────────────────────
  1150.  
  1151.  
  1152. [FUNCTION]
  1153.  
  1154. Procedure WFixX(              Var X              : INTEGER      );
  1155.  
  1156. [PARAMETERS]
  1157.  
  1158. X           VAR Modified X Coordinate
  1159.  
  1160. [RETURNS]
  1161.  
  1162. Function : None
  1163. (VAR     : [X] X Coordinate)
  1164.  
  1165. [DESCRIPTION]
  1166.  
  1167. If X < 0 then the value represented is the distance from the bottom
  1168. of the Screen rather than an absolute coordinate.  This function
  1169. checks for this and modifies the value accordingly.
  1170.  
  1171. [SEE-ALSO]
  1172.  
  1173. WFixY
  1174. WFixXY
  1175. WFixRectangle
  1176.  
  1177. [EXAMPLE]
  1178.  
  1179. VAR
  1180.   X : INTEGER;
  1181.  
  1182. BEGIN
  1183.  
  1184.   X := 30;
  1185.   WFixX( X );
  1186.  
  1187.   { X = 30 }
  1188.  
  1189.   X := -5;
  1190.   WFixX( X );
  1191.  
  1192.   { If the Screen Width was 80 then X = 75 }
  1193.  
  1194. END;
  1195.  
  1196.  
  1197. ──────────────────────────────────────────────────────────────────────────────
  1198.  
  1199.  
  1200. [FUNCTION]
  1201.  
  1202. Procedure WFixY(              Var Y              : INTEGER      );
  1203.  
  1204. [PARAMETERS]
  1205.  
  1206. Y           VAR Modified Y Coordinate
  1207.  
  1208. [RETURNS]
  1209.  
  1210. Function : None
  1211. (VAR     : [Y] Y Coordinate)
  1212.  
  1213. [DESCRIPTION]
  1214.  
  1215. If Y < 0 then the value represented is the distance from the bottom
  1216. of the Screen rather than an absolute coordinate.  This function
  1217. checks for this and modifies the value accordingly.
  1218.  
  1219. [SEE-ALSO]
  1220.  
  1221. WFixX
  1222. WFixXY
  1223. WFixRectangle
  1224.  
  1225. [EXAMPLE]
  1226.  
  1227. VAR
  1228.   Y : INTEGER;
  1229.  
  1230. BEGIN
  1231.  
  1232.   Y := 15;
  1233.   WFixY( Y );
  1234.  
  1235.   { Y = 15 }
  1236.  
  1237.   Y := -5;
  1238.   WFixY( Y );
  1239.  
  1240.   { If the Screen Height was 25 then Y = 20 }
  1241.  
  1242. END;
  1243.  
  1244.  
  1245. ──────────────────────────────────────────────────────────────────────────────
  1246.  
  1247.  
  1248. [FUNCTION]
  1249.  
  1250. Procedure WFixXY(             Var X, Y           : INTEGER      );
  1251.  
  1252. [PARAMETERS]
  1253.  
  1254. X           VAR Modified X Coordinate
  1255. Y           VAR Modified Y Coordinate
  1256.  
  1257. [RETURNS]
  1258.  
  1259. Function : None
  1260. (VAR     : [X] Modified X Coordinate)
  1261. (VAR     : [Y] Modified Y Coordinate)
  1262.  
  1263. [DESCRIPTION]
  1264.  
  1265. If X < 0 or Y < 0 then the value represented is the distance from the
  1266. Right or Bottom of the Screen, respectively, rather than an absolute
  1267. coordinate.  This function checks for this and modifies the values
  1268. accordingly.
  1269.  
  1270. [SEE-ALSO]
  1271.  
  1272. WFixX
  1273. WFixY
  1274. WFixRectangle
  1275.  
  1276. [EXAMPLE]
  1277.  
  1278.  
  1279. ──────────────────────────────────────────────────────────────────────────────
  1280.  
  1281.  
  1282. [FUNCTION]
  1283.  
  1284. Procedure WFixRectangle(      Var X1, Y1, X2, Y2 : INTEGER      );
  1285.  
  1286. [PARAMETERS]
  1287.  
  1288. X1          VAR Modified X1 Window Coordinate
  1289. Y1          VAR Modified Y1
  1290. X2          VAR Modified
  1291. Y2          VAR Modified Y2 Window Coordinate
  1292.  
  1293. [RETURNS]
  1294.  
  1295. [DESCRIPTION]
  1296.  
  1297. If and of the Rectangle Coordinates are Negative, they represent
  1298. Positions Relative to the Screen Boundaries rather than Absolute
  1299. Coordinates.  This function checks for this and modifies the
  1300. values accordingly.
  1301.  
  1302. Additionally, if the Right Point is Less than the Left Point, or
  1303. the Top more than the Bottom, these coordinates are swapped.  This
  1304. prevents windows from attempting to open with strange, erroneous
  1305. dimensions.
  1306.  
  1307. [SEE-ALSO]
  1308.  
  1309. WFixX
  1310. WFixY
  1311. WFixXY
  1312.  
  1313. [EXAMPLE]
  1314.  
  1315. VAR
  1316.   X1,Y1,X2,Y2 : INTEGER;
  1317.  
  1318. BEGIN
  1319.  
  1320.   { Assume Screen Dimensions of 80x25 }
  1321.  
  1322.   X1 :=  5;  Y1 := 2;
  1323.   X2 := 20;  Y2 := 7;
  1324.   WFixRectangle( X1, Y1, X2, Y2 );
  1325.   { Window Coordinates ( 5, 2, 20, 7 ) - all same }
  1326.  
  1327.  
  1328.   X1 :=   5;  Y1 :=  2;
  1329.   X2 := -20;  Y2 := -7;
  1330.   WFixRectangle( X1, Y1, X2, Y2 );
  1331.   { Window Coordinates ( 5, 2, 60, 18 ) - relative to border }
  1332.  
  1333.   X1 :=  15;  Y1 :=  2;
  1334.   X2 := -20;  Y2 := -7;
  1335.   WFixRectangle( X1, Y1, X2, Y2 );
  1336.   { Window Coordinates ( 5, 2, 15, 18 ) - swapped coords }
  1337.  
  1338. END;
  1339.  
  1340.  
  1341. ──────────────────────────────────────────────────────────────────────────────
  1342.  
  1343.  
  1344. [FUNCTION]
  1345.  
  1346. Procedure WAssertPointer(         P              : Pointer;
  1347.                                   Msg            : STRING       );
  1348.  
  1349. [PARAMETERS]
  1350.  
  1351. P           Pointer to Check
  1352. Msg         Error Message if NIL Pointer
  1353.  
  1354. [RETURNS]
  1355.  
  1356. (None)
  1357.  
  1358. [DESCRIPTION]
  1359.  
  1360. This function basically Filters Pointers to Ensure that they are
  1361. not NIL Pointers.  Pointers which are NIL never make it thru here
  1362. as a WError Message is presented and the Program is Halted.
  1363.  
  1364. If the Pointer is not NIL then everything is OK and the Program
  1365. Continues.
  1366.  
  1367. [SEE-ALSO]
  1368.  
  1369. WAssertHandle
  1370.  
  1371. [EXAMPLE]
  1372.  
  1373. VAR
  1374.   P : POINTER;
  1375.  
  1376. BEGIN
  1377.  
  1378.   GetMem( P, 1000 );
  1379.  
  1380.   WAssertPointer( P, 'Memory not Allocated' );  { EVERYTHING OK }
  1381.  
  1382.   { Basically do something with the Pointer before Deallocating it }
  1383.   FillChar( P^, SizeOf( 1000 ), 5 );
  1384.  
  1385.   FreeMem( P, 1000 );
  1386.  
  1387.   WAssertPointer( P, 'Pointer Not Assigned to Memory' );  { HALTS HERE }
  1388.  
  1389.   { Should have Halted before it reached this point }
  1390.   FillChar( P^, SizeOf( 1000 ), 7 );
  1391.  
  1392. END;
  1393.  
  1394.  
  1395. ──────────────────────────────────────────────────────────────────────────────
  1396.  
  1397.  
  1398. [FUNCTION]
  1399.  
  1400. Procedure WAssertHandle(          H              : THandle;
  1401.                                   Msg            : STRING       );
  1402.  
  1403. [PARAMETERS]
  1404.  
  1405. H           Handle (Pointer) to Check;
  1406. Msg         Error Message if NIL Handle
  1407.  
  1408. [RETURNS]
  1409.  
  1410. (None)
  1411.  
  1412. [DESCRIPTION]
  1413.  
  1414. This function basically Filters Handles (Pointers) to Ensure that they
  1415. are not NIL Handles.  Handles which are NIL never make it thru here as
  1416. a WError Message is presented and the Program is Halted.
  1417.  
  1418. If the Handle is not NIL then everything is OK and the Program
  1419. Continues.
  1420.  
  1421. [SEE-ALSO]
  1422.  
  1423. WAssertPointer
  1424.  
  1425. [EXAMPLE]
  1426.  
  1427. VAR
  1428.   H : POINTER;
  1429.  
  1430. BEGIN
  1431.  
  1432.   GetMem( H, 1000 );
  1433.  
  1434.   WAssertPointer( H, 'Handle Memory not Allocated' );  { EVERYTHING OK }
  1435.  
  1436.   { Basically do something with the Pointer before Deallocating it }
  1437.   FillChar( H^, SizeOf( 1000 ), 5 );
  1438.  
  1439.   FreeMem( H, 1000 );
  1440.  
  1441.   WAssertPointer( H, 'Handle Not Assigned to Memory' );  { HALTS HERE }
  1442.  
  1443.   { Should have Halted before it reached this point }
  1444.   FillChar( H^, SizeOf( 1000 ), 7 );
  1445.  
  1446. END;
  1447.  
  1448.  
  1449. ──────────────────────────────────────────────────────────────────────────────
  1450.  
  1451.  
  1452. [FUNCTION]
  1453.  
  1454. Function WRegionStoreAlloc(       Flags          : WORD;
  1455.                                   X1             : INTEGER;
  1456.                                   Y1             : INTEGER;
  1457.                                   X2             : INTEGER;
  1458.                                   Y2             : INTEGER      ):PRegionStore;
  1459.  
  1460. [PARAMETERS]
  1461.  
  1462. Flags       (These weren't used in the Code!)
  1463. X1          Left X Coordinate of Region
  1464. Y1          Upper Y Coordinate of Region
  1465. X2          Right X Coordinate of Region
  1466. Y2          Lower Y Coordinate of Region
  1467.  
  1468. [RETURNS]
  1469.  
  1470. Pointer to Stored Region Data in (Just the Memory, Data not here yet)
  1471.  
  1472. [DESCRIPTION]
  1473.  
  1474. This function Allocates enough memory to store a given region.  It simply
  1475. allocates the Memory, the Region Data is NOT stored Yet other than simply
  1476. the coordinates.
  1477.  
  1478. [SEE-ALSO]
  1479.  
  1480. WRegionStoreFree
  1481. WRegionStoreRead
  1482. WRegionStoreWrite
  1483. WRegionStoreCopy
  1484.  
  1485. [EXAMPLE]
  1486.  
  1487. VAR
  1488.   P : POINTER;
  1489.  
  1490. BEGIN
  1491.  
  1492.   P := WRegionStoreAlloc( 0, 5,2,20,7 );
  1493.  
  1494.   WAssertPointer( P, 'Memory Allocation Error' );
  1495.  
  1496.   WriteLn( 'Memory Must be Allocated, or it wouldn''t have made it here!' );
  1497.  
  1498.   While NOT WKeyPressed Do;
  1499.  
  1500.   WRegionStoreFree( P );
  1501.  
  1502. END;
  1503.  
  1504.  
  1505. ──────────────────────────────────────────────────────────────────────────────
  1506.  
  1507.  
  1508. [FUNCTION]
  1509.  
  1510. Procedure WRegionStoreFree(       RS             : PRegionStore );
  1511.  
  1512. [PARAMETERS]
  1513.  
  1514. RS          Pointer to Stored Region Data
  1515.  
  1516. [RETURNS]
  1517.  
  1518. (None)
  1519.  
  1520. [DESCRIPTION]
  1521.  
  1522. Disposes of any memory associated with this Data Pointer.
  1523.  
  1524. [SEE-ALSO]
  1525.  
  1526. WRegionStoreAlloc
  1527. WRegionStoreRead
  1528. WRegionStoreWrite
  1529. WRegionStoreCopy
  1530.  
  1531. [EXAMPLE]
  1532.  
  1533. VAR
  1534.   P : POINTER;
  1535.  
  1536. BEGIN
  1537.  
  1538.   P := WRegionStoreAlloc( 0, 5,2,20,7 );
  1539.  
  1540.   WAssertPointer( P, 'Memory Allocation Error' );
  1541.  
  1542.   WriteLn( 'Memory Must be Allocated, or it wouldn''t have made it here!' );
  1543.  
  1544.   While NOT WKeyPressed Do;
  1545.  
  1546.   WRegionStoreFree( P );
  1547.  
  1548. END;
  1549.  
  1550.  
  1551. ──────────────────────────────────────────────────────────────────────────────
  1552.  
  1553.  
  1554. [FUNCTION]
  1555.  
  1556. Procedure WRegionStoreRead(       RS             : PRegionStore );
  1557.  
  1558. [PARAMETERS]
  1559.  
  1560. RS          Pointer to Pre-Allocated Memory to store Region Data in
  1561.  
  1562. [RETURNS]
  1563.  
  1564. (None)
  1565.  
  1566. [DESCRIPTION]
  1567.  
  1568. This is the function which actually stores the Region Data!  It requires
  1569. the Caller to have called "WRegionStoreAlloc" to create and Allocate the
  1570. memory required for storage.  All we do here is simply read Screen Data
  1571. and Load it in the Storage Area.
  1572.  
  1573. [SEE-ALSO]
  1574.  
  1575. WRegionStoreAlloc
  1576. WRegionStoreFree
  1577. WRegionStoreWrite
  1578. WRegionStoreCopy
  1579.  
  1580. [EXAMPLE]
  1581.  
  1582. VAR
  1583.   P : POINTER;
  1584.   I : INTEGER;
  1585.  
  1586. BEGIN
  1587.  
  1588.   P := WRegionStoreAlloc( 0, 5,2,20,7 );
  1589.  
  1590.   WAssertPointer( P, 'Memory Allocation Error' );
  1591.  
  1592.  
  1593.   { Fill the Screen with Something }
  1594.  
  1595.   For i := 1 to 24 Do
  1596.     WriteLn( 'Memory Must be Allocated, or it wouldn''t have made it here!' );
  1597.  
  1598.  
  1599.   { And Read the Pre-Assigned Region }
  1600.  
  1601.   WRegionStoreRead( P );
  1602.  
  1603.   ClrScr;
  1604.   WriteLn( 'Press any Key to Restore the Region Data' );
  1605.   ch := WReadKey;
  1606.  
  1607.   { Write Region back to the Screen }
  1608.  
  1609.   WRegionStoreWrite( P );
  1610.   WRegionStoreFree( P );
  1611.  
  1612.   WriteLn;
  1613.   WriteLn;
  1614.   WriteLn( 'Press any key to Quit' );
  1615.   While NOT WKeyPressed Do;
  1616.  
  1617. END;
  1618.  
  1619.  
  1620. ──────────────────────────────────────────────────────────────────────────────
  1621.  
  1622.  
  1623. [FUNCTION]
  1624.  
  1625. Procedure WRegionStoreWrite(      RS             : PRegionStore );
  1626.  
  1627. [PARAMETERS]
  1628.  
  1629. RS          Pointer to Stored Region Data
  1630.  
  1631. [RETURNS]
  1632.  
  1633. (None)
  1634.  
  1635. [DESCRIPTION]
  1636.  
  1637. This function takes the Pre-Allocated and Pre-Read Storage Data and writes
  1638. it back out to the Screen.  If nothing has been Read into the Data area,
  1639. it will write out to the screen anything which happens to be there!
  1640.  
  1641. [SEE-ALSO]
  1642.  
  1643. WRegionStoreAlloc
  1644. WRegionStoreFree
  1645. WRegionStoreRead
  1646. WRegionStoreCopy
  1647.  
  1648. [EXAMPLE]
  1649.  
  1650. VAR
  1651.   P : POINTER;
  1652.   I : INTEGER;
  1653.  
  1654. BEGIN
  1655.  
  1656.   P := WRegionStoreAlloc( 0, 5,2,20,7 );
  1657.  
  1658.   WAssertPointer( P, 'Memory Allocation Error' );
  1659.  
  1660.  
  1661.   { Fill the Screen with Something }
  1662.  
  1663.   For i := 1 to 24 Do
  1664.     WriteLn( 'Memory Must be Allocated, or it wouldn''t have made it here!' );
  1665.  
  1666.  
  1667.   { And Read the Pre-Assigned Region }
  1668.  
  1669.   WRegionStoreRead( P );
  1670.  
  1671.   ClrScr;
  1672.   WriteLn( 'Press any Key to Restore the Region Data' );
  1673.   ch := WReadKey;
  1674.  
  1675.   { Write Region back to the Screen }
  1676.  
  1677.   WRegionStoreWrite( P );
  1678.   WRegionStoreFree( P );
  1679.  
  1680.   WriteLn;
  1681.   WriteLn;
  1682.   WriteLn( 'Press any key to Quit' );
  1683.   While NOT WKeyPressed Do;
  1684.  
  1685. END;
  1686.  
  1687.  
  1688. ──────────────────────────────────────────────────────────────────────────────
  1689.  
  1690.  
  1691. [FUNCTION]
  1692.  
  1693. Procedure WRegionStoreCopy(       SS             : PRegionStore;
  1694.                                   DS             : PRegionStore );
  1695.  
  1696. [PARAMETERS]
  1697.  
  1698. SS          Source Pointer to Storage Data
  1699. DS          Destination Pointer to Storage Data
  1700.  
  1701. [RETURNS]
  1702.  
  1703. (None)
  1704.  
  1705. [DESCRIPTION]
  1706.  
  1707. This function Duplicates the data which is in the Source Storage Area
  1708. to the Destination Storage Area.  Both Storage Pointers MUST be previously
  1709. allocated or the system will Halt with an Error Message.  Data is not
  1710. destroyed or Erased after the action.  Just that now there are 2 copies
  1711. of this data.
  1712.  
  1713. NOTE: These Regions MUST have been assigned with the Same Coordinates!
  1714. This will be handled in future editions.
  1715.  
  1716. [SEE-ALSO]
  1717.  
  1718. WRegionStoreAlloc
  1719. WRegionStoreFree
  1720. WRegionStoreRead
  1721. WRegionStoreWrite
  1722.  
  1723. [EXAMPLE]
  1724.  
  1725. VAR
  1726.   P1,P2 : POINTER;
  1727.  
  1728. BEGIN
  1729.  
  1730.   P1 := WRegionStoreAlloc( 0, 5,2,20,7 );
  1731.   P2 := WRegionStoreAlloc( 0, 5,2,20,7 );
  1732.  
  1733.   WAssertPointer( P1, 'Memory Allocation Error - P1' );
  1734.   WAssertPointer( P2, 'Memory Allocation Error - P2' );
  1735.  
  1736.   For i := 1 to 24 Do
  1737.     WriteLn( 'Memory Must be Allocated, or it wouldn''t have made it here!' );
  1738.  
  1739.   { Read the Region Data from screen }
  1740.  
  1741.   WRegionStoreRead( P1 );
  1742.  
  1743.   WriteLn( 'Region Read, Press any key to Continue' );
  1744.   ch := WReadKey;
  1745.   ClrScr;
  1746.  
  1747.   { Now copy the Region Data }
  1748.  
  1749.   WRegionStoreCopy( P1, P2 );
  1750.  
  1751.   { Just for good measure, let's get rid of this one }
  1752.  
  1753.   WRegionStoreFree( P1 );
  1754.   WriteLn( 'Press any Key to Copy Data' );
  1755.  
  1756.   WriteLn( 'Region Data has been copied and P1 Deallocated.' );
  1757.   WriteLn( 'Press any key to Restore Screen Region...' );
  1758.  
  1759.   ch := WReadKey;
  1760.   WRegionStoreWrite( P2 );
  1761.  
  1762.   WriteLn;
  1763.   WriteLn;
  1764.   WriteLn( 'Press any Key to Quit' );
  1765.   While NOT WKeyPressed Do;
  1766.  
  1767.   WRegionStoreFree( P2 );
  1768.  
  1769. END;
  1770.  
  1771.  
  1772. ──────────────────────────────────────────────────────────────────────────────
  1773.  
  1774.  
  1775. [FUNCTION]
  1776.  
  1777. Procedure WPushEnv;
  1778.  
  1779. [PARAMETERS]
  1780.  
  1781. (None)
  1782.  
  1783. [RETURNS]
  1784.  
  1785. (None)
  1786.  
  1787. [DESCRIPTION]
  1788.  
  1789. This function allows the caller to store (and later retrieve) the
  1790. current Window Environment to the Stack, so that temporary minor
  1791. or major modifications may be made to the Environment and later
  1792. returned to the original state.
  1793.  
  1794. Any Number of Pushes may be made throughout the program so long as
  1795. there is memory available.
  1796.  
  1797. [SEE-ALSO]
  1798.  
  1799. WPopEnv
  1800.  
  1801. [EXAMPLE]
  1802.  
  1803. BEGIN
  1804.  
  1805.   WPushEnv;
  1806.  
  1807.   WSet( 'SHADOWS' );
  1808.  
  1809.   WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE,'Window');
  1810.  
  1811.   While NOT WKeyPressed Do;
  1812.  
  1813.   WDispose( 'Window' );
  1814.  
  1815.   WPopEnv;
  1816.  
  1817.   { We should not be back to our previous Environment Settings }
  1818.  
  1819. END;
  1820.  
  1821.  
  1822. ──────────────────────────────────────────────────────────────────────────────
  1823.  
  1824.  
  1825. [FUNCTION]
  1826.  
  1827. Procedure WPopEnv;
  1828.  
  1829. [PARAMETERS]
  1830.  
  1831. (None)
  1832.  
  1833. [RETURNS]
  1834.  
  1835. (None)
  1836.  
  1837. [DESCRIPTION]
  1838.  
  1839. This function allows the caller to retrieve the last Pushed Window
  1840. Environment from the Stack, and make it the Current Window Environment
  1841. Style.
  1842.  
  1843. [SEE-ALSO]
  1844.  
  1845. WPushEnv
  1846.  
  1847. [EXAMPLE]
  1848.  
  1849. BEGIN
  1850.  
  1851.   WPushEnv;
  1852.  
  1853.   WSet( 'SHADOWS' );
  1854.  
  1855.   WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE,'Window');
  1856.  
  1857.   While NOT WKeyPressed Do;
  1858.  
  1859.   WDispose( 'Window' );
  1860.  
  1861.   WPopEnv;
  1862.  
  1863.   { We should now be back to our previous Environment Settings }
  1864.  
  1865. END;
  1866.  
  1867.  
  1868. ──────────────────────────────────────────────────────────────────────────────
  1869.  
  1870.  
  1871. [FUNCTION]
  1872.  
  1873. Procedure WPushScreen;
  1874.  
  1875. [PARAMETERS]
  1876.  
  1877. (None)
  1878.  
  1879. [RETURNS]
  1880.  
  1881. (None)
  1882.  
  1883. [DESCRIPTION]
  1884.  
  1885. This function allows the caller to store (and later retrieve) the
  1886. current Screen on a Stack, so that temporary minor or major
  1887. modifications may be made to the Screen and later returned to the
  1888. original state.
  1889.  
  1890. This is especially useful when shelling to another program that
  1891. modifies the screen.  You want to restore things when you get back,
  1892. so you Push the Screen before you leave and Pop it afterwards.
  1893.  
  1894. Any Number of Pushes may be made throughout the program so long as
  1895. there is memory available.
  1896.  
  1897. [SEE-ALSO]
  1898.  
  1899. WPopScreen
  1900.  
  1901. [EXAMPLE]
  1902.  
  1903. BEGIN
  1904.  
  1905.   WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE,'Window');
  1906.   WPushScreen;
  1907.  
  1908.   WSFastWrite( 30, 10, WHITE,RED, 'THIS IS A TEST - JUST A TEST!!!!' );
  1909.   WSFastWrite( 30, 11, WHITE,RED, 'PRESS ANY KEY TO GET RID OF THIS STUFF' );
  1910.   ch := WReadKey;
  1911.  
  1912.   WPopScreen;
  1913.  
  1914.   { We should not be back to our previous Environment Settings }
  1915.  
  1916.   While NOT WKeyPressed Do;
  1917.   WDispose( 'Window' );
  1918.  
  1919. END;
  1920.  
  1921.  
  1922. ──────────────────────────────────────────────────────────────────────────────
  1923.  
  1924.  
  1925. [FUNCTION]
  1926.  
  1927. Procedure WPopScreen;
  1928.  
  1929. [PARAMETERS]
  1930.  
  1931. (None)
  1932.  
  1933. [RETURNS]
  1934.  
  1935. (None)
  1936.  
  1937. [DESCRIPTION]
  1938.  
  1939. This function allows the caller to Retrieve (from a Previous Push)
  1940. the last stored Screen on the Stack.  This is done to correct any
  1941. minor or major modifications that may have been made to the Screen.
  1942.  
  1943. This is especially useful when shelling to another program that
  1944. modifies the screen.  You want to restore things when you get back,
  1945. so you Push the Screen before you leave and Pop it afterwards.
  1946.  
  1947. Any Number of Pushes may be made throughout the program so long as
  1948. there is memory available.
  1949.  
  1950. [SEE-ALSO]
  1951.  
  1952. WPopScreen
  1953.  
  1954. [EXAMPLE]
  1955.  
  1956. BEGIN
  1957.  
  1958.   WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE,'Window');
  1959.   WPushScreen;
  1960.  
  1961.   WSFastWrite( 30, 10, WHITE,RED, 'THIS IS A TEST - JUST A TEST!!!!' );
  1962.   WSFastWrite( 30, 11, WHITE,RED, 'PRESS ANY KEY TO GET RID OF THIS STUFF' );
  1963.   ch := WReadKey;
  1964.  
  1965.   WPopScreen;
  1966.  
  1967.   { We should not be back to our previous Environment Settings }
  1968.  
  1969.   While NOT WKeyPressed Do;
  1970.   WDispose( 'Window' );
  1971.  
  1972. END;
  1973.  
  1974.  
  1975. ──────────────────────────────────────────────────────────────────────────────
  1976.  
  1977.  
  1978. [FUNCTION]
  1979.  
  1980. Function WOnWinEdge(              TheWin         : PWin;
  1981.                                   X              : INTEGER;
  1982.                                   Y              : INTEGER      ) : BOOLEAN;
  1983.  
  1984. [PARAMETERS]
  1985.  
  1986. TheWin      Pointer to Window Data Structure
  1987. X           X Screen Coordinate
  1988. Y           Y Screen Coordinate
  1989.  
  1990. [RETURNS]
  1991.  
  1992. Whether or not this Screen Coordinate is the Border of the given Window
  1993.  
  1994. [DESCRIPTION]
  1995.  
  1996. Tests the provided Coordinates and determines whether or not these
  1997. Screen Coordinates are on the Border of the provided Window.  If
  1998. So it returns a TRUE else a FALSE.
  1999.  
  2000. This is mainly used to determine if a mouse button is depressed upon
  2001. the window border (so as to move the whole window with the mouse).
  2002.  
  2003. [SEE-ALSO]
  2004.  
  2005. [EXAMPLE]
  2006.  
  2007. BEGIN
  2008.  
  2009.   WNew( x,y,x,y,WHITE,BLUE,WHITE,BLUE,'Window' );
  2010.  
  2011.   WriteLn( '(25,10) on Border : ', WOnWinEdge( p, 5, 15 ) );
  2012.  
  2013. END;
  2014.  
  2015.  
  2016. ──────────────────────────────────────────────────────────────────────────────
  2017.  
  2018.  
  2019. [FUNCTION]
  2020.  
  2021. Procedure MultiWriteTime(         Status         : BYTE;
  2022.                               Var IData          : Pointer      ); Far;
  2023.  
  2024. [PARAMETERS]
  2025.  
  2026. Status      ?
  2027. IData       ?
  2028.  
  2029. [RETURNS]
  2030.  
  2031. (None)
  2032.  
  2033. [DESCRIPTION]
  2034.  
  2035. If the Clock is ON in the Window Environment, then this function will
  2036. update the Display Time at the upper right corner of the Screen.
  2037.  
  2038. This is an internal function intended only to be used by the system.
  2039. It links with the Multi-tasker and allows a continuous time update
  2040. ion the screen.
  2041.  
  2042. This is a Very Low-Level Function and should be allowed to be loaded
  2043. by the WOpen Operation (Unless you are familiar with the Multi-Tasking
  2044. Unit.
  2045.  
  2046. [SEE-ALSO]
  2047.  
  2048. WOpen
  2049.  
  2050. [EXAMPLE]
  2051.  
  2052. (None Available)
  2053.  
  2054.  
  2055. ──────────────────────────────────────────────────────────────────────────────
  2056.  
  2057.  
  2058. [FUNCTION]
  2059.  
  2060. Function WReadButtonListRel(      Blist          : PButtonList;
  2061.                                   X              : INTEGER;
  2062.                                   Y              : INTEGER;
  2063.                                   Count          : BYTE         ):INTEGER;
  2064.  
  2065. [PARAMETERS]
  2066.  
  2067. BList       Pointer to Button List Data
  2068. X           X Screen Coordinate
  2069. Y           Y Screen Coordinate
  2070. Count       Number of Buttons in the List
  2071.  
  2072. [RETURNS]
  2073.  
  2074. Which Button in List the Screen Coordinates Reference (255=None)
  2075.  
  2076. [DESCRIPTION]
  2077.  
  2078. This function Tests a Screen Coordinate with the Button List Data to
  2079. determine if this coordinate represents any of the Buttons in the list.
  2080. If so, the Button Index is returned, otherwise the value 255 is returned.
  2081.  
  2082. [SEE-ALSO]
  2083.  
  2084. WReadButtonList
  2085. WSReadButtonList
  2086. CheckInvisibleButtons
  2087.  
  2088. [EXAMPLE]
  2089.  
  2090. VAR
  2091.   X,Y,I : INTEGER;
  2092.   BR    : TButtonList;
  2093.   ch    : CHAR;
  2094.  
  2095. BEGIN
  2096.  
  2097.   MakeBRec( Addr( BR[1] ),  5,20, WHITE,BLUE, 'Button 1' );
  2098.   MakeBRec( Addr( BR[2] ), 25,10, WHITE,BLUE, 'Button 2' );
  2099.   MakeBRec( Addr( BR[3] ), 50,15, WHITE,BLUE, 'Button 3' );
  2100.   MakeBRec( Addr( BR[4] ), 70, 5, WHITE,BLUE, 'Button 4' );
  2101.  
  2102.   WMessage( 'Press any Key to Test another Coord|<ESC>=Quit', WHITE,CYAN );
  2103.  
  2104.   REPEAT
  2105.     x := Random( 80 );
  2106.     y := Random( 25 );
  2107.  
  2108.     I := WReadButtonListRel( Addr(BR), X, Y, 4);
  2109.     Write( 'Coords (',x,',',y,') = ' );
  2110.  
  2111.     If i <> 255 Then
  2112.       WriteLn( 'Button ',i )
  2113.     Else
  2114.       WriteLn( 'No Button' );
  2115.  
  2116.     ch := WReadKey;
  2117.  
  2118.   UNTIL ch = #27;
  2119.  
  2120. END;
  2121.  
  2122.  
  2123. ──────────────────────────────────────────────────────────────────────────────
  2124.  
  2125.  
  2126. [FUNCTION]
  2127.  
  2128. Function WReadButtonList(         BList          : PButtonList;
  2129.                                   Count          : BYTE         ) : INTEGER;
  2130.  
  2131. [PARAMETERS]
  2132.  
  2133. BList       Pointer to Button List Data
  2134. Count       Number of Buttons in List
  2135.  
  2136. [RETURNS]
  2137.  
  2138. Which Button the Mouse is Currently ON
  2139.  
  2140. [DESCRIPTION]
  2141.  
  2142. This function Tests the Current Mouse Window Coordinate and determines
  2143. if this coordinate represents any of the Buttons in the list.  If so,
  2144. the Button Index is returned, otherwise the value 255 is returned.
  2145.  
  2146. The Button List Data is prepared as Window Relative Coordinates and
  2147. so the Mouse test is also Window Relative.
  2148.  
  2149. [SEE-ALSO]
  2150.  
  2151. WReadButtonListRel
  2152. WSReadButtonList
  2153. CheckInvisibleButtons
  2154.  
  2155. [EXAMPLE]
  2156.  
  2157. VAR
  2158.   X,Y,I : INTEGER;
  2159.   BR    : TButtonList;
  2160.   ch    : CHAR;
  2161.  
  2162. BEGIN
  2163.  
  2164.   MakeBRec( Addr( BR[1] ),  5,20, WHITE,BLUE, 'Button 1' );
  2165.   MakeBRec( Addr( BR[2] ), 25,10, WHITE,BLUE, 'Button 2' );
  2166.   MakeBRec( Addr( BR[3] ), 50,15, WHITE,BLUE, 'Button 3' );
  2167.   MakeBRec( Addr( BR[4] ), 70, 5, WHITE,BLUE, 'Button 4' );
  2168.  
  2169.   WMessage( 'Press any Key to Test another Coord|<ESC>=Quit', WHITE,CYAN );
  2170.  
  2171.   REPEAT
  2172.     x := Random( 80 );
  2173.     y := Random( 25 );
  2174.  
  2175.     I := WReadButtonListRel( Addr(BR), X, Y, 4);
  2176.     Write( 'Coords (',x,',',y,') = ' );
  2177.  
  2178.     If i <> 255 Then
  2179.       WriteLn( 'Button ',i )
  2180.     Else
  2181.       WriteLn( 'No Button' );
  2182.  
  2183.     ch := WReadKey;
  2184.  
  2185.   UNTIL ch = #27;
  2186.  
  2187. END;
  2188.  
  2189.  
  2190. ──────────────────────────────────────────────────────────────────────────────
  2191.  
  2192.  
  2193. [FUNCTION]
  2194.  
  2195. Function WSReadButtonList(        BList          : PButtonList;
  2196.                                   Count          : BYTE         ) : INTEGER;
  2197.  
  2198. [PARAMETERS]
  2199.  
  2200. BList       Pointer to Button List Data
  2201. Count       Number of Buttons in List
  2202.  
  2203. [RETURNS]
  2204.  
  2205. Which Button the Mouse is Currently ON
  2206.  
  2207. [DESCRIPTION]
  2208.  
  2209. This function Tests the Current Mouse Screen Coordinate and determines
  2210. if this coordinate represents any of the Buttons in the list.  If so,
  2211. the Button Index is returned, otherwise the value 255 is returned.
  2212.  
  2213. The Button List Data is prepared as Window Relative Coordinates and
  2214. so the Mouse test is also Window Relative.
  2215.  
  2216. [SEE-ALSO]
  2217.  
  2218. WReadButtonListRel
  2219. WReadButtonList
  2220. CheckInvisibleButtons
  2221.  
  2222. [EXAMPLE]
  2223.  
  2224.  
  2225. ──────────────────────────────────────────────────────────────────────────────
  2226.  
  2227.  
  2228. [FUNCTION]
  2229.  
  2230. Function CheckInvisibleButtons(   B              : TButtonList4;
  2231.                                   Count          : BYTE         ) : STRING;
  2232.  
  2233. [PARAMETERS]
  2234.  
  2235. B           Button List Array
  2236. Count       Number of Buttons Listed
  2237.  
  2238. [RETURNS]
  2239.  
  2240. [DESCRIPTION]
  2241.  
  2242. Some Mouse Buttons may be "Invisible" Buttons such as text contained upon
  2243. a message or other text status line.  A button isn't actually drawn there
  2244. as the text is sufficient, however this does not change the fact that the
  2245. area is an Active Button.
  2246.  
  2247. When This function is called, the current Mouse coordinates are checked
  2248. with button list to determine if ANY Button is below it.  If it happens
  2249. to be an "Invisible" Button, the Text below it is compared with one of
  2250. the Invisible Button Text to determine what function is being referenced.
  2251.  
  2252. Invisible Button Text must be one of the Following:
  2253.  
  2254.   "<ESC>"
  2255.   "<SPACE>"
  2256.   "<ENTER>"
  2257.   "<Fx>"  (Where X is a Number from 1 to Max Function Key Nbr)
  2258.           (ie. "<F10>")
  2259.  
  2260. [SEE-ALSO]
  2261.  
  2262. WReadButtonListRel
  2263. WReadButtonList
  2264. WSReadButtonList
  2265.  
  2266. [EXAMPLE]
  2267.  
  2268.  
  2269. ──────────────────────────────────────────────────────────────────────────────
  2270.  
  2271.  
  2272. [FUNCTION]
  2273.  
  2274. Procedure WShowFreeMemKeyProc(    Status         : BYTE;
  2275.                                   Key1, Key2     : CHAR         ); Far;
  2276.  
  2277. [PARAMETERS]
  2278.  
  2279. Status
  2280. Key1
  2281. Key2
  2282.  
  2283. [RETURNS]
  2284.  
  2285. (None)
  2286.  
  2287. [DESCRIPTION]
  2288.  
  2289. [SEE-ALSO]
  2290.  
  2291. [EXAMPLE]
  2292.  
  2293.  
  2294. ──────────────────────────────────────────────────────────────────────────────
  2295.  
  2296.  
  2297. [FUNCTION]
  2298.  
  2299. Procedure WKeyDriverProc(         IDP            : PInDriverPacket ); Far;
  2300.  
  2301. [PARAMETERS]
  2302.  
  2303. IDP         Pointer to In-Driver Packet
  2304.  
  2305. [RETURNS]
  2306.  
  2307. (None)
  2308.  
  2309. [DESCRIPTION]
  2310.  
  2311. This is the Low-Level Input Driver Function that supports all Keyboard,
  2312. Mouse, and other Input.  It is submitted as the In-Driver Procedure to
  2313. the In Driver System.  And supports all higher-level functions.
  2314.  
  2315. [SEE-ALSO]
  2316.  
  2317. [EXAMPLE]
  2318.  
  2319.  
  2320. ──────────────────────────────────────────────────────────────────────────────
  2321.  
  2322.  
  2323. [FUNCTION]
  2324.  
  2325. Procedure WVkeyInit;
  2326.  
  2327. [PARAMETERS]
  2328.  
  2329. (None)
  2330.  
  2331. [RETURNS]
  2332.  
  2333. (None)
  2334.  
  2335. [DESCRIPTION]
  2336.  
  2337. ****** THIS FUNCTION NOT IMPLEMENTED! ******
  2338.  
  2339. [SEE-ALSO]
  2340.  
  2341. [EXAMPLE]
  2342.  
  2343.  
  2344. ──────────────────────────────────────────────────────────────────────────────
  2345.  
  2346.  
  2347. [FUNCTION]
  2348.  
  2349. Function WKeyPressed                                              : BOOLEAN;
  2350.  
  2351. [PARAMETERS]
  2352.  
  2353. (None)
  2354.  
  2355. [RETURNS]
  2356.  
  2357. Whether a Key is Pressed or in the Window Key Buffer
  2358.  
  2359. [DESCRIPTION]
  2360.  
  2361. Checks the Window Key Buffer and the Keyboard and returns whether
  2362. a key is available.
  2363.  
  2364. [SEE-ALSO]
  2365.  
  2366. WIDoReadKey
  2367.  
  2368. [EXAMPLE]
  2369.  
  2370. BEGIN
  2371.  
  2372.   WriteLn( 'Press any Key' );
  2373.   WriteLn( 'WKeyPressed = ',WKeyPressed );
  2374.  
  2375.   While NOT WKeyPressed Do;
  2376.   WriteLn( 'WKeyPressed = ',WKeyPressed );
  2377.  
  2378. END;
  2379.  
  2380.  
  2381. ──────────────────────────────────────────────────────────────────────────────
  2382.  
  2383.  
  2384. [FUNCTION]
  2385.  
  2386. Function WIDoReadKey                                              : CHAR;
  2387.  
  2388. [PARAMETERS]
  2389.  
  2390. (None)
  2391.  
  2392. [RETURNS]
  2393.  
  2394. The First Key in the Window Key Buffer (or Keyboard)
  2395.  
  2396. [DESCRIPTION]
  2397.  
  2398. Reads the first Key in the Window Key Buffer or the Keyboard, in order
  2399. of priority.
  2400.  
  2401. [SEE-ALSO]
  2402.  
  2403. WKeyPressed
  2404.  
  2405. [EXAMPLE]
  2406.  
  2407. Uses VGen,VWinLow;
  2408.  
  2409. VAR
  2410.   ch : CHAR;
  2411.  
  2412. BEGIN
  2413.  
  2414.   WriteLn( 'This Tests continues until you press ESC' );
  2415.  
  2416.   REPEAT
  2417.  
  2418.     ch := WIDoReadKey;
  2419.     WriteLn( 'Ch = ',ByteToHex(Ord(ch)),'h = ',Ord(ch):3,'d = ',ch );
  2420.  
  2421.   UNTIL ch = #27;
  2422. END;
  2423.  
  2424.  
  2425. ──────────────────────────────────────────────────────────────────────────────
  2426.  
  2427.  
  2428. [FUNCTION]
  2429.  
  2430. Procedure WInitColorMap;
  2431.  
  2432. [PARAMETERS]
  2433.  
  2434. (None)
  2435.  
  2436. [RETURNS]
  2437.  
  2438. (None)
  2439.  
  2440. [DESCRIPTION]
  2441.  
  2442. *****THIS FUNCTION NOT IMPLEMENTED*****
  2443.  
  2444. [SEE-ALSO]
  2445.  
  2446. [EXAMPLE]
  2447.  
  2448.  
  2449. ──────────────────────────────────────────────────────────────────────────────
  2450.  
  2451.  
  2452. [FUNCTION]
  2453.  
  2454. Procedure WTextColor(             Color          : INTEGER      );
  2455.  
  2456. [PARAMETERS]
  2457.  
  2458. FC          New Text Foreground Color
  2459. BC          New Text Background Color
  2460.  
  2461. [RETURNS]
  2462.  
  2463. (None)
  2464.  
  2465. [DESCRIPTION]
  2466.  
  2467. This function sets both the text foreground and background colors for the
  2468. active window.  If there is no active window, it will set the colors for
  2469. the console screen itself.
  2470.  
  2471. [SEE-ALSO]
  2472.  
  2473. WTextColor
  2474. WTextBackGround
  2475. WTextAttr
  2476.  
  2477. [EXAMPLE]
  2478.  
  2479. VAR
  2480.   I : INTEGER;
  2481.  
  2482. BEGIN
  2483.  
  2484.   For i ;= 0 to 15 Do
  2485.   BEGIN
  2486.  
  2487.     WTextColor( i );
  2488.     Write( 'Fore' );
  2489.  
  2490.   END;  { For i }
  2491.  
  2492. END;
  2493.  
  2494.  
  2495. ──────────────────────────────────────────────────────────────────────────────
  2496.  
  2497.  
  2498. [FUNCTION]
  2499.  
  2500. Procedure WTextBackGround(        Color          : INTEGER      );
  2501.  
  2502. [PARAMETERS]
  2503.  
  2504. Color       New Text Background Color
  2505.  
  2506. [RETURNS]
  2507.  
  2508. (None)
  2509.  
  2510. [DESCRIPTION]
  2511.  
  2512. This function sets the text background color for the active window.
  2513. If there is no active window, it will set the text background color
  2514. for the console screen itself.
  2515.  
  2516. [SEE-ALSO]
  2517.  
  2518. WTextColor
  2519. WTextColors
  2520. WTextAttr
  2521.  
  2522. [EXAMPLE]
  2523.  
  2524. VAR
  2525.   I : INTEGER;
  2526.  
  2527. BEGIN
  2528.  
  2529.   For i := 0 to 7 Do
  2530.   BEGIN
  2531.  
  2532.     WTextBackGround( i );
  2533.     Write( 'Back' );
  2534.  
  2535.   END;  { For i }
  2536.  
  2537. END;
  2538.  
  2539.  
  2540. ──────────────────────────────────────────────────────────────────────────────
  2541.  
  2542.  
  2543. [FUNCTION]
  2544.  
  2545. Procedure WTextAttr(              Attr           : BYTE         );
  2546.  
  2547. [PARAMETERS]
  2548.  
  2549. Attr        New Text Attribute Byte
  2550.  
  2551. [RETURNS]
  2552.  
  2553. (None)
  2554.  
  2555. [DESCRIPTION]
  2556.  
  2557. This function sets the text attribute the active window.
  2558. If there is no active window, it will set the text attribute for the
  2559. console screen itself.
  2560.  
  2561. [SEE-ALSO]
  2562.  
  2563. WTextColor
  2564. WTextBackGround
  2565. WTextColors
  2566.  
  2567. [EXAMPLE]
  2568.  
  2569. VAR
  2570.   I : INTEGER;
  2571.  
  2572. BEGIN
  2573.  
  2574.   For i := 0 to 64 Do
  2575.   BEGIN
  2576.  
  2577.     WTextAttr( i );
  2578.     Write( 'X' );
  2579.  
  2580.   END;  { For i }
  2581. END;
  2582.  
  2583.  
  2584. ──────────────────────────────────────────────────────────────────────────────
  2585.  
  2586.  
  2587. [FUNCTION]
  2588.  
  2589. Procedure WTextColors(            FC             : INTEGER;
  2590.                                   BC             : INTEGER      );
  2591.  
  2592. [PARAMETERS]
  2593.  
  2594. FC          New Text Foreground Color
  2595. BC          New Text Background Color
  2596.  
  2597. [RETURNS]
  2598.  
  2599. (None)
  2600.  
  2601. [DESCRIPTION]
  2602.  
  2603. This function sets both the text foreground and background colors for the
  2604. active window.  If there is no active window, it will set the colors for
  2605. the console screen itself.
  2606.  
  2607. [SEE-ALSO]
  2608.  
  2609. WTextColor
  2610. WTextBackGround
  2611. WTextAttr
  2612.  
  2613. [EXAMPLE]
  2614.  
  2615. VAR
  2616.   i : INTEGER;
  2617. BEGIN
  2618.  
  2619.   For i := 0 to 7 Do
  2620.   BEGIN
  2621.  
  2622.     WTextColors( 7-i, i );
  2623.     WriteLn( 'Fore & Back' );
  2624.  
  2625.   END;  { For i }
  2626.  
  2627. END;
  2628.  
  2629.  
  2630. ──────────────────────────────────────────────────────────────────────────────
  2631.  
  2632.  
  2633. [FUNCTION]
  2634.  
  2635. Procedure WCursorOFF;
  2636.  
  2637. [PARAMETERS]
  2638.  
  2639. (None)
  2640.  
  2641. [RETURNS]
  2642.  
  2643. (None)
  2644.  
  2645. [DESCRIPTION]
  2646.  
  2647. Turns OFF the Text Cursor
  2648.  
  2649. [SEE-ALSO]
  2650.  
  2651. WCursorOn
  2652. WCursorBig
  2653. WCursorSmall
  2654. WPointerOn
  2655. WPointerOff
  2656.  
  2657. [EXAMPLE]
  2658.  
  2659. VAR
  2660.   ch : CHAR;
  2661.  
  2662. BEGIN
  2663.  
  2664.   WriteLn( 'The Cursor is ON' );
  2665.   WriteLn( 'Press any key to Hide it...' );
  2666.  
  2667.   ch := WReadKey;
  2668.   WCursorOFF;
  2669.  
  2670.   WriteLn;
  2671.   WriteLn( 'Now the Cursor is Hidden' );
  2672.   WriteLn( 'Press any key to Restore it...' );
  2673.  
  2674.   ch := WReadKey;
  2675.   WCursorOn;
  2676.  
  2677. END;
  2678.  
  2679.  
  2680. ──────────────────────────────────────────────────────────────────────────────
  2681.  
  2682.  
  2683. [FUNCTION]
  2684.  
  2685. Procedure WCursorON;
  2686.  
  2687. [PARAMETERS]
  2688.  
  2689. (None)
  2690.  
  2691. [RETURNS]
  2692.  
  2693. (None)
  2694.  
  2695. [DESCRIPTION]
  2696.  
  2697. Turns ON the Text Cursor
  2698.  
  2699. [SEE-ALSO]
  2700.  
  2701. WCursorOff
  2702. WCursorBig
  2703. WCursorSmall
  2704. WPointerOn
  2705. WPointerOff
  2706.  
  2707. [EXAMPLE]
  2708.  
  2709. VAR
  2710.   ch : CHAR;
  2711.  
  2712. BEGIN
  2713.  
  2714.   WriteLn( 'The Cursor is ON' );
  2715.   WriteLn( 'Press any key to Hide it...' );
  2716.  
  2717.   ch := WReadKey;
  2718.   WCursorOFF;
  2719.  
  2720.   WriteLn;
  2721.   WriteLn( 'Now the Cursor is Hidden' );
  2722.   WriteLn( 'Press any key to Restore it...' );
  2723.  
  2724.   ch := WReadKey;
  2725.   WCursorOn;
  2726.  
  2727. END;
  2728.  
  2729.  
  2730. ──────────────────────────────────────────────────────────────────────────────
  2731.  
  2732.  
  2733. [FUNCTION]
  2734.  
  2735. Procedure WCursorSMALL;
  2736.  
  2737. [PARAMETERS]
  2738.  
  2739. (None)
  2740.  
  2741. [RETURNS]
  2742.  
  2743. (None)
  2744.  
  2745. [DESCRIPTION]
  2746.  
  2747. Makes the Text Cursor a Standard Underline
  2748.  
  2749. [SEE-ALSO]
  2750.  
  2751. WCursorOn
  2752. WCursorOff
  2753. WCursorBig
  2754. WPointerOn
  2755. WPointerOff
  2756.  
  2757. [EXAMPLE]
  2758.  
  2759. BEGIN
  2760.  
  2761.   WCursorSMALL;
  2762.  
  2763.   { The Text Cursor is now a Normal Blinking UnderLine }
  2764.  
  2765. END;
  2766.  
  2767.  
  2768. ──────────────────────────────────────────────────────────────────────────────
  2769.  
  2770.  
  2771. [FUNCTION]
  2772.  
  2773. Procedure WCursorBIG;
  2774.  
  2775. [PARAMETERS]
  2776.  
  2777. (None)_
  2778.  
  2779. [RETURNS]
  2780.  
  2781. (None)
  2782.  
  2783. [DESCRIPTION]
  2784.  
  2785. Make the Text Cursor a large Block
  2786.  
  2787. [SEE-ALSO]
  2788.  
  2789. WCursorOn
  2790. WCursorOff
  2791. WCursorSmall
  2792. WPointerOn
  2793. WPointerOff
  2794.  
  2795. [EXAMPLE]
  2796.  
  2797. BEGIN
  2798.  
  2799.   WCursorBIG;
  2800.  
  2801.   { The Text Cursor is now a Big Blinking Block }
  2802.  
  2803. END;
  2804.  
  2805.  
  2806. ──────────────────────────────────────────────────────────────────────────────
  2807.  
  2808.  
  2809. [FUNCTION]
  2810.  
  2811. Procedure WMPointerOn;
  2812.  
  2813. [PARAMETERS]
  2814.  
  2815. (None)
  2816.  
  2817. [RETURNS]
  2818.  
  2819. (None)
  2820.  
  2821. [DESCRIPTION]
  2822.  
  2823. Turns ON the Text Mouse Pointer
  2824.  
  2825. [SEE-ALSO]
  2826.  
  2827. WCursorOn
  2828. WCursorOff
  2829. WCursorBig
  2830. WCursorSmall
  2831. WPointerOff
  2832.  
  2833. [EXAMPLE]
  2834.  
  2835. BEGIN
  2836.  
  2837.   WMPointerOn;
  2838.  
  2839.   { The Mouse Pointer is now displayed (if supported) }
  2840.  
  2841. END;
  2842.  
  2843.  
  2844. ──────────────────────────────────────────────────────────────────────────────
  2845.  
  2846.  
  2847. [FUNCTION]
  2848.  
  2849. Procedure WMPointerOff;
  2850.  
  2851. [PARAMETERS]
  2852.  
  2853. (None)
  2854.  
  2855. [RETURNS]
  2856.  
  2857. (None)
  2858.  
  2859. [DESCRIPTION]
  2860.  
  2861. Turns OFF the Text Mouse Pointer
  2862.  
  2863. [SEE-ALSO]
  2864.  
  2865. WCursorOn
  2866. WCursorOff
  2867. WCursorBig
  2868. WCursorSmall
  2869. WPointerOn
  2870.  
  2871. [EXAMPLE]
  2872.  
  2873. BEGIN
  2874.  
  2875.   WMPointerOff;
  2876.  
  2877.   { The Mouse Pointer is now Hidden (even if supported) }
  2878.  
  2879. END;
  2880.  
  2881.  
  2882. ──────────────────────────────────────────────────────────────────────────────
  2883.  
  2884.  
  2885. [FUNCTION]
  2886.  
  2887. Procedure WMGetStatus(        Var Buttons        : INTEGER;
  2888.                               Var X              : INTEGER;
  2889.                               Var Y              : INTEGER      );
  2890.  
  2891. [PARAMETERS]
  2892.  
  2893. Buttons     VAR Returned Mouse Button Status Flags (Left,Center,Right)
  2894. X           VAR Returned Mouse X Coordinate
  2895. Y           VAR Returned Mouse Y Coordinate
  2896.  
  2897. [RETURNS]
  2898.  
  2899. Function : None
  2900. (VAR     : [Buttons] Mouse Button Status Flags)
  2901. (VAR     : [X] Mouse X Coordinate)
  2902. (VAR     : [Y] Mouse Y Coordinate)
  2903.  
  2904. [DESCRIPTION]
  2905.  
  2906. Reads and Returns the Mouse Buttons Status as well as the current
  2907. Mouse coordinates.
  2908.  
  2909. [SEE-ALSO]
  2910.  
  2911. WMWaitForNoButtons
  2912.  
  2913. [EXAMPLE]
  2914.  
  2915. BEGIN
  2916.  
  2917.   { make button list }
  2918.  
  2919.   REPEAT
  2920.  
  2921.     { check to see where mouse is }
  2922.  
  2923.     { display report }
  2924.  
  2925.   UNTIL ch = #27;
  2926.  
  2927. END;
  2928.  
  2929.  
  2930. ──────────────────────────────────────────────────────────────────────────────
  2931.  
  2932.  
  2933. [FUNCTION]
  2934.  
  2935. Procedure WMWaitForNOButtons;
  2936.  
  2937. [PARAMETERS]
  2938.  
  2939. (None)
  2940.  
  2941. [RETURNS]
  2942.  
  2943. (None)
  2944.  
  2945. [DESCRIPTION]
  2946.  
  2947. Waits until User has released ALL Mouse Buttons before proceeding.
  2948.  
  2949. [SEE-ALSO]
  2950.  
  2951. WMGetStatus
  2952.  
  2953. [EXAMPLE]
  2954.  
  2955. VAR
  2956.   ch : CHAR;
  2957.  
  2958. BEGIN
  2959.  
  2960.   WriteLn( 'Hold Down a Mouse Button...' );
  2961.  
  2962.   While NOT WKeyPressed Do;
  2963.  
  2964.   WriteLn;
  2965.   WriteLn( 'Now release the Button whenever you like.' );
  2966.  
  2967.   WMWaitFoNOButtons;
  2968.  
  2969.   WriteLn( 'OK, You have just released the Mouse Button' );
  2970.  
  2971.   While WKeyPressed Do;  { get rid of any keys }
  2972.     Ch := WReadKey;
  2973.  
  2974.   WriteLn;
  2975.   WriteLn( 'Press any key to Quit...' );
  2976.   While NOT WKeyPressed Do;
  2977.  
  2978. END;
  2979.  
  2980.  
  2981. ──────────────────────────────────────────────────────────────────────────────
  2982.  
  2983.  
  2984. [FUNCTION]
  2985.  
  2986. Procedure WError(                 Error          : ST80         );
  2987.  
  2988. [PARAMETERS]
  2989.  
  2990. Error       Window Error Text to display before halting pgm
  2991.  
  2992. [RETURNS]
  2993.  
  2994. (None)
  2995.  
  2996. [DESCRIPTION]
  2997.  
  2998. This function displays a Window-Library Error and halts the program.
  2999. It is mainly used by other Window Library functions when Critical Errors
  3000. occur.
  3001.  
  3002. [SEE-ALSO]
  3003.  
  3004. [EXAMPLE]
  3005.  
  3006. BEGIN
  3007.  
  3008. END;
  3009.  
  3010.  
  3011. ──────────────────────────────────────────────────────────────────────────────
  3012.  
  3013.  
  3014. [FUNCTION]
  3015.  
  3016. Function WColorFromString(        S              : STRING       ) : BYTE;
  3017.  
  3018. [PARAMETERS]
  3019.  
  3020. S           Text color, as a string.  IE: "RED"
  3021.  
  3022. [RETURNS]
  3023.  
  3024. Numeric Color Value
  3025.  
  3026. [DESCRIPTION]
  3027.  
  3028. This function converts a Text String Color Name into a Color Value.
  3029. This function is NOT Case Sensitive.
  3030.  
  3031. [SEE-ALSO]
  3032.  
  3033. [EXAMPLE]
  3034.  
  3035. CONST
  3036.   ColorNames = ARRAY[0..7] of STRING =
  3037.                ( 'BLACK','WHITE','BLUE','GREEN',
  3038.                  'RED','YELLOW','CYAN','MAGENTA' );
  3039. VAR
  3040.   I : INTEGER;
  3041.  
  3042. BEGIN
  3043.  
  3044.   Textbackground( WHITE );
  3045.  
  3046.   For i := 0 to 7 Do
  3047.   BEGIN
  3048.     TextColor( WColorFromString( ColorNames[i] ) );
  3049.     WriteLn( ColorNames[i] );
  3050.   END;  { For i }
  3051.  
  3052. END;
  3053.  
  3054.  
  3055. ──────────────────────────────────────────────────────────────────────────────
  3056.  
  3057.  
  3058. [FUNCTION]
  3059.  
  3060. Procedure WSet(                   S              : ST80         );
  3061.  
  3062. [PARAMETERS]
  3063.  
  3064. S           Window Environment Command String
  3065.  
  3066. [RETURNS]
  3067.  
  3068. (None)
  3069.  
  3070. [DESCRIPTION]
  3071.  
  3072. Alters the Current Window Environment based upons the commands provided
  3073. in the provided Environment Command String.
  3074.  
  3075. The Window Environment String may contain one or more of the following
  3076. Sub-Strings (separated by commas) :
  3077.  
  3078.   "LOOK=x"       - Sets the General "Look" of the Window.  Each Look
  3079.                    contains such things as Window Shadows, Single or
  3080.                    Double Borders, or even Altered Color Palettes.
  3081.                    Basically a Look represents a predetermined
  3082.                    combination of any of the following data.  ("x"
  3083.                    represents a look number)
  3084.  
  3085.   "NOACTIVE"     - Normally the Active Window's Frame is highlighted.
  3086.                    To disable this, use this call.
  3087.  
  3088.   "ACTIVE"       - Normally the Active Window's Frame is highlighted.
  3089.                    If this had been changed at any point, this will
  3090.                    restore this condition.
  3091.  
  3092.   "BORDER=x"     - Sets the Window Borders to the Style Number given
  3093.                    as "x".  Currently this Range is 1-9
  3094.  
  3095.   "NOSHADOW"     - Disables Shadows on the Active Window.
  3096.  
  3097.   "SHADOW"       - Enables Shadows on the Active Window and all Windows
  3098.                    which have Shadow Locking On.
  3099.  
  3100.   "NOEVENTS"     - Turns off Window Environment Event Handling.  (See
  3101.                    "EVENTS")
  3102.  
  3103.   "EVENTS"       - Turns on Window Environment Event Handling. When
  3104.                    Events are on, any key or mouse input will be flagged
  3105.                    by the Window Environment as an Event.  Some Input
  3106.                    routines use this to jump out on Non-Input Keys.
  3107.  
  3108.   "NOLOCKSHADOW" - Turns off Window Shadow Locking.  Normally only the
  3109.                    Active Window is allowed to have Shadows.  If this
  3110.                    had been changed, it is restore by this.
  3111.  
  3112.   "LOCKSHADOW"   - Turns on Window Shadow Locking.  Normally only the
  3113.                    Active Window is allowed to have Shadows.  If you
  3114.                    wish to override this and leave shadows on any window,
  3115.                    use this call.
  3116.  
  3117.   "NOMOUSE"      - Deactivates Mouse support (even if it exists)
  3118.  
  3119.   "MOUSE"        - Activates Mouse support if it exists.
  3120.  
  3121.   "KHITS=x"      - Sets the Number of Key/Mouse Hits which represent
  3122.                    the User Accepting a certain action (like acting
  3123.                    on a Pressed Button).  Sometimes it is better to
  3124.                    use a Double-Click when scrolling thru a List box
  3125.                    to avoid inadvertent data selection. ("x" is the
  3126.                    desired Key/Mouse Hits meaning OK - either 1 or 2).
  3127.  
  3128.   "MLBACK=x"     - Establishes the Menu Line Background Color, where
  3129.                    "x" represents a Color TEXT.
  3130.  
  3131.   "MLFORE=x"     - Establishes the Menu Line Foreground Color, where
  3132.                    "x" represents a Color TEXT.
  3133.  
  3134.   "GEMICOLOR=x"  - Establishes the Dialog Box Icon Foreground Color,
  3135.                    where "x" represents a Color TEXT.
  3136.  
  3137.   "GEMFORE=x"    - Establishes the Dialog Box's Foreground Color,
  3138.                    where "x" represents a Color TEXT.
  3139.  
  3140.   "GEMBACK=x"    - Establishes the Dialog Box's Background Color,
  3141.                    where "x" represents a Color TEXT.
  3142.  
  3143.   "GEMHBACK=x"   - Establishes the Dialog Box's Highlighted Background
  3144.                    ????????, where "x" represents a Color TEXT.
  3145.   Then
  3146.         WinEnv.GemHBack := WColorFromString( ParamData )
  3147.       Else
  3148.  
  3149.   "GEMHFORE=x"   - Establishes the Dialog Box's Highlighted Foreground
  3150.                    ????????, where "x" represents a Color TEXT.
  3151.   Then
  3152.         WinEnv.GemHFore := WColorFromString( ParamData )
  3153.       Else
  3154.  
  3155.   "GEMNBACK=x"   - Establishes the Dialog Box's Normal Background
  3156.                    ????????, where "x" represents a Color TEXT.
  3157.   Then
  3158.         WinEnv.GemNBack := WColorFromString( ParamData )
  3159.       Else
  3160.  
  3161.   "GEMNFORE=x"   - Establishes the Dialog Box's Normal Foreground
  3162.                    ????????, where "x" represents a Color TEXT.
  3163.   Then
  3164.         WinEnv.GemNFore := WColorFromString( ParamData )
  3165.       Else
  3166.  
  3167.   "GEMBUTTON=x"  - Establishes the Dialog Box's Button Type, where "x"
  3168.                    represents a Button Type Number.
  3169.  
  3170.   "GEMHBUTTON=x" - Extablishes the Dialog Box's Highlighted Button
  3171.                    Type, where "x" represents a Button Type Number.
  3172.  
  3173. One of the few things that cannot be changed afterwords is the Screen
  3174. Resolution, or the Clock.  These MUST be taken care of when the Window
  3175. Environment System is Initialized (by a call to "WOpen").
  3176.  
  3177. [SEE-ALSO]
  3178.  
  3179. WOpen
  3180.  
  3181. [EXAMPLE]
  3182.  
  3183. BEGIN
  3184.  
  3185.   WSet( 'LOOK=2,NOACTIVE,NOMOUSE,EVENTS' );
  3186.  
  3187.   {---------------------------------------------------}
  3188.   { Sets the Display Look to #2                       }
  3189.   { Disables Active Window Border Highlighting        }
  3190.   { Disables Mouse support                            }
  3191.   { Enables Events handling for all actions hereafter }
  3192.   {---------------------------------------------------}
  3193.  
  3194. END;
  3195.  
  3196.  
  3197. ──────────────────────────────────────────────────────────────────────────────
  3198.  
  3199.  
  3200. [FUNCTION]
  3201.  
  3202. Function WFExist(                 FName          : STRING       ) : BOOLEAN;
  3203.  
  3204. [PARAMETERS]
  3205.  
  3206. FName       Name of File to search for
  3207.  
  3208. [RETURNS]
  3209.  
  3210. Whether the file was found to Exist
  3211.  
  3212. [DESCRIPTION]
  3213.  
  3214. Searches for a file of a given name and returns whether it was found.
  3215. This is mainly used a an internal Windows function for when the Windows
  3216. System would need to find and use a file.
  3217.  
  3218. [SEE-ALSO]
  3219.  
  3220. (None)
  3221.  
  3222. [EXAMPLE]
  3223.  
  3224. BEGIN
  3225.  
  3226.   WriteLn( 'File ENVIRON.DEF Existed : ', WFExist( 'ENVIRON.DEF' ) );
  3227.  
  3228.   { Probably won't find this file and thus report FALSE }
  3229.  
  3230. END;
  3231.  
  3232.  
  3233. ──────────────────────────────────────────────────────────────────────────────
  3234.  
  3235.  
  3236. [FUNCTION]
  3237.  
  3238. Procedure WBackRefresh(           S              : STRING;
  3239.                                   FC             : BYTE;
  3240.                                   BC             : BYTE         );
  3241.  
  3242. [PARAMETERS]
  3243.  
  3244. S           Background Pattern String
  3245. FC          Foreground Color
  3246. BC          Background Color
  3247.  
  3248. [RETURNS]
  3249.  
  3250. (None)
  3251.  
  3252. [DESCRIPTION]
  3253.  
  3254. This function refreshes the Screen Background Pattern
  3255.  
  3256. [SEE-ALSO]
  3257.  
  3258. [EXAMPLE]
  3259.  
  3260. VAR
  3261.   ch : CHAR;
  3262.  
  3263. BEGIN
  3264.           ╥╙╘╒╓╫╫╪┘┌█╥╤╨╧╬
  3265.   WOpen( '═', BLACK, BLUE, 'NOMOUSE' );
  3266.  
  3267.   { Now Let's mess up the screen a bit }
  3268.  
  3269.   WMessage( 'Press any Key to Refresh the Screen' ,WHITE, BLACK );
  3270.  
  3271.   TextColors( WHITE, RED );
  3272.   GotoXY( 1, 1 );
  3273.   While NOT WKeyPressed Do
  3274.     Write( Random( 255 ) );
  3275.  
  3276.   { And when a Key was pressed, Refresh the Background }
  3277.  
  3278.   ch := WReadKey;
  3279.  
  3280.   WBackRefresh( '═', BLACK, BLUE );
  3281.  
  3282.   WMessage( 'Press any key to Quit', WHITE, BLACK );
  3283.   While NOT WKeyPressed Do;
  3284.   WClose;
  3285.  
  3286. END;
  3287.  
  3288.  
  3289. ──────────────────────────────────────────────────────────────────────────────
  3290.  
  3291.  
  3292. [FUNCTION]
  3293.  
  3294. Procedure WSubmitBorder(          X              : INTEGER;
  3295.                                   S              : ST80;
  3296.                                   SBIFore        : BYTE;
  3297.                                   SBIBack        : BYTE;
  3298.                                   Attr           : LONGINT      );
  3299.  
  3300. [PARAMETERS]
  3301.  
  3302. X           Border String Number
  3303. S           Border Definition String (1 Char Per Type)
  3304. SBIFore     (Not Currently Used)
  3305. SBIBack     (Not Currently Used)
  3306. Attr        (Not Currently Used)
  3307.  
  3308. [RETURNS]
  3309.  
  3310. (None)
  3311.  
  3312. [DESCRIPTION]
  3313.  
  3314. A Border Definition String is a String of 38 Characters, each representing
  3315. a different Border Type Character.  They are as Follows:
  3316.  
  3317.   WSubmitBorder(  1, '┌┐└┘──││[]├┤┴┬╞╡╨╥─═│║                ',
  3318.                   0,0, cwbTitleLeft+cwbColorStyleAll                     );
  3319.  
  3320.   WSubmitBorder(  2, '╔╗╚╝══║║[]╟╢╧╤╠╣╩╦─═│║                ',
  3321.                   0,0, cwbTitleLeft+cwbColorStyleAll                     );
  3322.  
  3323.   WSubmitBorder(  3, '╒╕╘╛══││[]├┤╧╤╞╡╩╦─═│║                ',
  3324.                   0,0, cwbTitleLeft+cwbColorStyleAll                     );
  3325.  
  3326.   WSubmitBorder(  4, '╓╖╙╜──║║[]╟╢┴┬╠╣╨╥─═│║                ',
  3327.                   0,0, cwbTitleLeft+cwbColorStyleAll                     );
  3328.  
  3329.   WSubmitBorder(  5, '████▀▄██  ██████████│█                ',
  3330.                   0,0, cwbTitleLEft+cwbColorStyleAll                     );
  3331.  
  3332.   WSubmitBorder(  6, '                    │                 ',
  3333.                   0,0, cwbTitleLeft+cwbColorStyleAll                     );
  3334.  
  3335.   WSubmitBorder(  7, '             ',
  3336.                   0,0, cwbTitleLEft+cwbColorStyleAll                     );
  3337.  
  3338.   WSubmitBorder(  8, '++++--||[]          |                 ',
  3339.                   0,0,cwbTitleLEft+cwbColorStyleAll                     );
  3340.  
  3341.   WSubmitBorder(  9, '╔╗╚╝╠═╖║[]╟╢╧╤╠╣╩╦─═│║φε╖║∩≡cc......cc',
  3342.                   0,0,  cwbTitleLeft+cwbColorStyleTop                     );
  3343.  
  3344.   WSubmitBorder( 10, '┌┐└┘──││  ├┤┴┬╞╡╨╥─═│║                ',
  3345.                  0,0, cwbTitleLeft+cwbColorStyleAll                      );
  3346.  
  3347.  
  3348.   Example : S = '┌┐└┘──││[]├┤┴┬╞╡╨╥─═│║                '
  3349.  
  3350.                                              1 2 3 4 5 6 7 8 9 10
  3351.  
  3352.   Char  1 = Upper Left Window Corner         ┌ ╔ ╒ ╓ █   █ + ╔ ┌
  3353.   Char  2 = Upper Right Window Corner        ┐ ╗ ╕ ╖ █   █ + ╗ ┐
  3354.   Char  3 = Lower Left Window Corner         └ ╚ ╘ ╙ █   █ + ╚ └
  3355.   Char  4 = Lower Right Window Corner        ┘ ╝ ╛ ╜ █   █ + ╝ ┘
  3356.  
  3357.   Char  5 = Upper Horizontal                 ─ ═ ═ ─ ▀   █ - ╠ ─
  3358.   Char  6 = Lower Horizontal                 ─ ═ ═ ─ ▄   █ - ═ ─
  3359.   Char  7 = Left Vertical                    │ ║ │ ║ █   █ | ╖ │
  3360.   Char  8 = Right Vertical                   │ ║ │ ║ █   █ | ║ │
  3361.  
  3362.   Char  9 = Window Text Opening Char         [ [ [ [       [ [
  3363.   Char 10 = Window Text Closing Char         ] ] ] ]       ] ]
  3364.  
  3365.   Char 11 = Left to Internal Single Line     ├ ╟ ├ ╟ █   █   ╟ ├
  3366.   Char 12 = Right toInternal Single Line     ┤ ╢ ┤ ╢ █   █   ╢ ┤
  3367.   Char 13 = Bottom to Internal Single Line   ┴ ╧ ╧ ┴ █   █   ╧ ┴
  3368.   Char 14 = Top to Internal Single Line      ┬ ╤ ╤ ┬ █   █   ╤ ┬
  3369.  
  3370.   Char 15 = Left to Internal Double Line     ╞ ╠ ╞ ╠ █   █   ╠ ╞
  3371.   Char 16 = Right to Internal Double Line    ╡ ╣ ╡ ╣ █   █   ╣ ╡
  3372.   Char 17 = Bottom to Internal Double Line   ╨ ╩ ╩ ╨ █   █   ╩ ╨
  3373.   Char 18 = Top to Internal Double Line      ╥ ╦ ╦ ╥ █   █   ╦ ╥
  3374.  
  3375.   Char 19 = Horizontal Internal Single Line  ─ ─ ─ ─ █   █   ─ ─
  3376.   Char 20 = Horizontal Internal Double Line  ═ ═ ═ ═ █   █   ═ ═
  3377.   Char 21 = Vertical Internal Single Line    │ │ │ │ │ │ │ | │ │
  3378.   Char 22 = Vertical Internal Double Line    ║ ║ ║ ║ █   █   ║ ║
  3379.  
  3380.   Char 23 = Extended Characters                              φ
  3381.   Char 24 =   "           "                                  ε
  3382.   Char 25 =   "           "                                  ╖
  3383.   Char 26 =   "           "                                  ║
  3384.   Char 27 =   "           "                                  ∩
  3385.   Char 28 =   "           "                                  ≡
  3386.   Char 29 =   "           "                                  c
  3387.   Char 30 =   "           "                                  c
  3388.   Char 31 =   "           "                                  .
  3389.   Char 32 =   "           "                                  .
  3390.   Char 33 =   "           "                                  .
  3391.   Char 34 =   "           "                                  .
  3392.   Char 35 =   "           "                                  .
  3393.   Char 36 =   "           "                                  .
  3394.   Char 37 =   "           "                                  c
  3395.   Char 38 =   "           "                                  c
  3396.  
  3397.  
  3398.  
  3399. [SEE-ALSO]
  3400.  
  3401. [EXAMPLE]
  3402.  
  3403. BEGIN
  3404.  
  3405.   WSubmitBorder(  1, '┌┐└┘──││[]├┤┴┬╞╡╨╥─═│║                ',
  3406.                   0,0, cwbTitleLeft+cwbColorStyleAll           );
  3407.  
  3408.   {--------------------------------------------------------}
  3409.   { Sets Window Border Type 1 to an All-Single Border Type }
  3410.   { with the Window Title Name set Left                    }
  3411.   {--------------------------------------------------------}
  3412.  
  3413. END;
  3414.  
  3415.  
  3416. ──────────────────────────────────────────────────────────────────────────────
  3417.  
  3418.  
  3419. [FUNCTION]
  3420.  
  3421. Procedure WOpen(                  BackGroundCH   : ST80;
  3422.                                   TxtColor       : BYTE;
  3423.                                   BckColor       : BYTE;
  3424.                                   S              : ST80         );
  3425.  
  3426. [PARAMETERS]
  3427.  
  3428. BackGroundCH  Screen Background Pattern String
  3429. TxtColor      Window Text Foreground Color
  3430. BckColor      Window Text Background Color
  3431. S             Window Environment Initialization Command String
  3432.  
  3433. [RETURNS]
  3434.  
  3435. (None)
  3436.  
  3437. [DESCRIPTION]
  3438.  
  3439. The Screen Background Pattern String is a string which is displayed
  3440. as the background of the entire Window Environment.  It is repeated
  3441. over and over on each line of the Background.  This string can be
  3442. of any length or any set of characters.  If the screen is 80x25 and
  3443. the Pattern is 1 Char, then there will be 80 of these per line.
  3444. If the Pattern is 5 Chars (like a Name), it will be repeated 16 times
  3445. per line, for each and every line of the background.  This can result
  3446. in some pretty interesting screen patterns.
  3447.  
  3448. Whatever the Pattern, it is displayed in the provided screen colors.
  3449.  
  3450. The Window Environment may contain one or more of the following
  3451. Sub-Strings (separated by commas) :
  3452.  
  3453.   "KEEPSCREEN" - When Shelling out to other Windows Program, use
  3454.                  this to keep and later restore the Parent Window
  3455.                  Screen.  The Child Program will look as if it were
  3456.                  running right in the Parent.
  3457.  
  3458.   "SUPER-REZ"  - Use this when you wish the Windows to support the
  3459.                  Highest Resolution available.
  3460.  
  3461.   "MONO"       - Set Display to Mono Mode (see B/W)
  3462.  
  3463.   "LOOK=X"     - This establishes the "Look" of all windows.
  3464.   (Where x is    If it is 1 then ...
  3465.     1 or 2)      And if it is 2 then ...
  3466.  
  3467.   "SHADOW"     - Allows use of Shadows on all Active Windows Drawn
  3468.  
  3469.   "B/W"        - Sets display to Black & White (Mono) Mode
  3470.  
  3471.   "HIRES"      - Uses the highest Screen Resolution available
  3472.                  by the monitor (See SUPER-REZ)
  3473.  
  3474.   "MOUSE"      - Ensures the Mouse is Activated if Present
  3475.  
  3476.   "KHITS=X"    - Establishes the number of Mouse Button Hits representing
  3477.   (Where x is    a user selection.  Sometimes 1 is too little or 2 too much.
  3478.     1 or 2)
  3479.  
  3480.   "NOACTIVE"   - Normally the Active Window has it's Frame Highlighted.
  3481.                  This Parameter is used to disable this for all windows.
  3482.  
  3483.   "CLOCK"      - This parameter activates a Clock (Date & Time) featured
  3484.                  at the upper right of the screen (on the Program Name
  3485.                  Bar).  This Clock will thereafter display the current
  3486.                  time as a background task.
  3487.  
  3488. [SEE-ALSO]
  3489.  
  3490. WClose
  3491.  
  3492. [EXAMPLE]
  3493.  
  3494. BEGIN
  3495.  
  3496.   WOpen('▒', BLACK,BLUE,'CLOCK,MOUSE,LOOK=1,SUPER-REZ');
  3497.  
  3498.   WPrgNameMsg( 'Program Name Vers 1.0', WHITE, CYAN )
  3499.   WMessage( 'This is the Window System.  Press any Key to Quit', WHITE,CYAN
  3500.   While NOT WKeyPressed Do;
  3501.  
  3502.   WClose;
  3503.  
  3504. END;
  3505.  
  3506.  
  3507. ──────────────────────────────────────────────────────────────────────────────
  3508.  
  3509.  
  3510. [FUNCTION]
  3511.  
  3512. Procedure WDrawBorder(            TheWin         : PWin         );
  3513.  
  3514. [PARAMETERS]
  3515.  
  3516. [RETURNS]
  3517.  
  3518. [DESCRIPTION]
  3519.  
  3520. ****** THIS FUNCTION NOT IMPLEMENTED! ******
  3521.  
  3522. [SEE-ALSO]
  3523.  
  3524. [EXAMPLE]
  3525.  
  3526.  
  3527. ──────────────────────────────────────────────────────────────────────────────
  3528.  
  3529.  
  3530. [FUNCTION]
  3531.  
  3532. Procedure WinDoBox(               X              : INTEGER;
  3533.                                   Y              : INTEGER;
  3534.                                   X2             : INTEGER;
  3535.                                   Y2             : INTEGER;
  3536.                                   WFC            : INTEGER;
  3537.                                   WBC            : INTEGER;
  3538.                                   FC             : INTEGER;
  3539.                                   BC             : INTEGER;
  3540.                                   Name           : ST80;
  3541.                                   Style          : INTEGER      );
  3542.  
  3543. [PARAMETERS]
  3544.  
  3545. X           Left Window Coordinate
  3546. Y           Top Window Coordinate
  3547. X2          Right Window Coordinate
  3548. Y2          Bottom Window Coordinate
  3549. WFC         Window Foreground Color
  3550. WBC         Window Background Color
  3551. FC          Border Foreground Color
  3552. BC          Border Background Color
  3553. Name        Window Title Text
  3554. Style
  3555.  
  3556. [RETURNS]
  3557.  
  3558. (None)
  3559.  
  3560. [DESCRIPTION]
  3561.  
  3562. [SEE-ALSO]
  3563.  
  3564. WinReDoBox
  3565.  
  3566. [EXAMPLE]
  3567.  
  3568.  
  3569. ──────────────────────────────────────────────────────────────────────────────
  3570.  
  3571.  
  3572. [FUNCTION]
  3573.  
  3574. Procedure WinReDoBox(             X              : INTEGER;
  3575.                                   Y              : INTEGER;
  3576.                                   X2             : INTEGER;
  3577.                                   Y2             : INTEGER;
  3578.                                   FC             : INTEGER;
  3579.                                   BC             : INTEGER;
  3580.                                   Style          : INTEGER      );
  3581.  
  3582. [PARAMETERS]
  3583.  
  3584. X           Left Window Coordinate
  3585. Y           Top Window Coordinate
  3586. X2          Right Window Coordinate
  3587. Y2          Bottom Window Coordinate
  3588. FC
  3589. BC
  3590. Style       Box Border Style
  3591.  
  3592. [RETURNS]
  3593.  
  3594. (None)
  3595.  
  3596. [DESCRIPTION]
  3597.  
  3598. [SEE-ALSO]
  3599.  
  3600. WinDoBox
  3601.  
  3602. [EXAMPLE]
  3603.  
  3604.  
  3605. ──────────────────────────────────────────────────────────────────────────────
  3606.  
  3607.  
  3608. [FUNCTION]
  3609.  
  3610. Procedure WClear(                 X              : INTEGER;
  3611.                                   Y              : INTEGER;
  3612.                                   X2             : INTEGER;
  3613.                                   Y2             : INTEGER;
  3614.                                   FC             : INTEGER;
  3615.                                   BC             : INTEGER      );
  3616.  
  3617. [PARAMETERS]
  3618.  
  3619. X           Left Screen Coordinate of Region to Clear
  3620. Y           Top Screen Coordinate of Region to Clear
  3621. X2          Right Screen Coordinate of Region to Clear
  3622. Y2          Botton Screen Coordinate of Region to Clear
  3623. FC          Foreground color to Clear Region with
  3624. BC          Background color to Clear Region with
  3625.  
  3626. [RETURNS]
  3627.  
  3628. (None)
  3629.  
  3630. [DESCRIPTION]
  3631.  
  3632. Clears the Specific Window Area on the Screen and Initializes it with the
  3633. provided Foreground and Background colors.
  3634.  
  3635. [SEE-ALSO]
  3636.  
  3637. [EXAMPLE]
  3638.  
  3639. BEGIN
  3640.  
  3641.   WClear( 5,2,20,7,WHITE,BLUE );
  3642.  
  3643. END;
  3644.  
  3645.  
  3646. ──────────────────────────────────────────────────────────────────────────────
  3647.  
  3648.  
  3649. [FUNCTION]
  3650.  
  3651. Procedure WDefWinEventProc(       Win            : PWin;
  3652.                                   Event          : TWinEvent    ); Far;
  3653.  
  3654. [PARAMETERS]
  3655.  
  3656. Win         Pointer to Window Data
  3657. Event       Handle to Window Event Data
  3658.  
  3659. [RETURNS]
  3660.  
  3661. (None)
  3662.  
  3663. [DESCRIPTION]
  3664.  
  3665. ****** THIS FUNCTION NOT IMPLEMENTED! ******
  3666.  
  3667. This is the Default Windows Event Procedure.  Currently it does nothing.
  3668.  
  3669. [SEE-ALSO]
  3670.  
  3671. [EXAMPLE]
  3672.  
  3673.  
  3674. ──────────────────────────────────────────────────────────────────────────────
  3675.  
  3676.  
  3677. [FUNCTION]
  3678.  
  3679. Procedure WNewEx(                 X              : INTEGER;
  3680.                                   Y              : INTEGER;
  3681.                                   X2             : INTEGER;
  3682.                                   Y2             : INTEGER;
  3683.                                   FC             : BYTE;
  3684.                                   BC             : BYTE;
  3685.                                   BordFC         : BYTE;
  3686.                                   BordBC         : BYTE;
  3687.                                   Border         : WORD;
  3688.                                   Flags          : LONGINT;
  3689.                                   EventProc      : TWinEventProc;
  3690.                                   Name           : ST80         );
  3691.  
  3692. [PARAMETERS]
  3693.  
  3694. X           Left Window Coordinate
  3695. Y           Top Window Coordinate
  3696. X2          Right Window Coordinate
  3697. Y2          Bottom Window Coordinate
  3698. FC          Window Foreground Color
  3699. BC          Window Background Color
  3700. BordFC      Window Border Foreground Color
  3701. BordBC      Window Border Background Color
  3702. Border      Border Type
  3703. Flags       Window Flags
  3704. EventProc   Default Window Event Procedure
  3705. Name        Name to Identify Window With (also in Window Title)
  3706.  
  3707. [RETURNS]
  3708.  
  3709. (None)
  3710.  
  3711. [DESCRIPTION]
  3712.  
  3713. This is the actual function which creates a New Window.  It is an
  3714. Internal Function only.
  3715.  
  3716. It takes care of everything necessary to saving the background along
  3717. with drawing the window itself.
  3718.  
  3719. [SEE-ALSO]
  3720.  
  3721. WNew
  3722. WDispose
  3723.  
  3724. [EXAMPLE]
  3725.  
  3726. BEGIN
  3727.  
  3728.   WNewEx( 5, 2, 20, 7,
  3729.           WHITE,BLUE,WHITE,CYAN,
  3730.           1,cwnShadow, WDefWinEventProc,
  3731.           'Window' );
  3732.  
  3733.   {-----------------------------------------------------------------}
  3734.   { Creates a new window at ( 5, 2, 20, 7 )                         }
  3735.   { with the Window being WHITE on BLUE with a WHITE on CYAN Border }
  3736.   { The Border uses Characters from the Border 1 Definition Set     }
  3737.   { The Window has Shadows and uses the Default Event Procedure     }
  3738.   { And finally, the window is called "Window"                      }
  3739.   {-----------------------------------------------------------------}
  3740.  
  3741. END;
  3742.  
  3743.  
  3744. ──────────────────────────────────────────────────────────────────────────────
  3745.  
  3746.  
  3747. [FUNCTION]
  3748.  
  3749. Procedure WNew(                   X              : INTEGER;
  3750.                                   Y              : INTEGER;
  3751.                                   X2             : INTEGER;
  3752.                                   Y2             : INTEGER;
  3753.                                   FC             : BYTE;
  3754.                                   BC             : BYTE;
  3755.                                   BorderFC       : BYTE;
  3756.                                   BorderBC       : BYTE;
  3757.                                   Name           : ST80         );
  3758.  
  3759. [PARAMETERS]
  3760.  
  3761. X           Left Screen Coordinate
  3762. Y           Top Screen Coordinate
  3763. X2          Right Screen Coordinate
  3764. Y2          Bottom Screen Coordinate
  3765. FC          Window Foreground Color
  3766. BC          Window Background Color
  3767. BorderFC    Window Border Foreground Color
  3768. BorderBC    Window Border Background Color
  3769. Name        Name to Identify Window with (also used in Border Title)
  3770.  
  3771. [RETURNS]
  3772.  
  3773. (None)
  3774.  
  3775. [DESCRIPTION]
  3776.  
  3777. Creates a brand new window using the sizes and colors provided.
  3778. If desired sizes are to be relative to the screen edges then the
  3779. number of line away from the screen edge used as a negative number
  3780. may be used in any input coordinate value.  Also all references to
  3781. this window will be the given Window Name until otherwise changed.
  3782.  
  3783. [SEE-ALSO]
  3784.  
  3785. WEnter
  3786. WExit
  3787. WGo
  3788. WDispose
  3789. WNewEx
  3790.  
  3791. [EXAMPLE]
  3792.  
  3793. BEGIN
  3794.  
  3795.   WNew( 5,2,20,7, WHITE,BLUE,WHITE,BLUE, 'Window' );
  3796.  
  3797.   WriteLn( 'Press any key to Dispose of Window...' );
  3798.   While NOT WKeyPressed Do;
  3799.  
  3800.   WDispose( 'Window' );
  3801.  
  3802. END;
  3803.  
  3804.  
  3805. ──────────────────────────────────────────────────────────────────────────────
  3806.  
  3807.  
  3808. [FUNCTION]
  3809.  
  3810. Procedure WEnter(                 Name           : ST80         );
  3811.  
  3812. [PARAMETERS]
  3813.  
  3814. [RETURNS]
  3815.  
  3816. [DESCRIPTION]
  3817.  
  3818. [SEE-ALSO]
  3819.  
  3820. [EXAMPLE]
  3821.  
  3822. VAR
  3823.   ch : CHAR;
  3824.  
  3825. BEGIN
  3826.  
  3827.   WNew( 5,2,20,7, WHITE,BLUE,WHITE,BLUE, 'Window' );
  3828.  
  3829.   WriteLn( 'Press any key to Exit this Window...' );
  3830.   ch := WReadKey;
  3831.   WExit;
  3832.  
  3833.   WMessage( 'Press any key to return to the Window...', WHITE, CYAN );
  3834.   ch := WReadKey;
  3835.   WEnter( 'Window' );
  3836.  
  3837.   WMessage( 'Press any key to Quit', WHITE, CYAN );
  3838.   WriteLn( 'Press any key to Quit...' );
  3839.   ch := WReadKey;
  3840.  
  3841.   WDispose( 'Window' );
  3842.  
  3843. END;
  3844.  
  3845.  
  3846. ──────────────────────────────────────────────────────────────────────────────
  3847.  
  3848.  
  3849. [FUNCTION]
  3850.  
  3851. Procedure WExit;
  3852.  
  3853. [PARAMETERS]
  3854.  
  3855. (None)
  3856.  
  3857. [RETURNS]
  3858.  
  3859. (None)
  3860.  
  3861. [DESCRIPTION]
  3862.  
  3863. This function ensures that All Windows are considered NOT Active.
  3864.  
  3865. [SEE-ALSO]
  3866.  
  3867. WNew
  3868. WEnter
  3869. WGo
  3870. WDispose
  3871.  
  3872. [EXAMPLE]
  3873.  
  3874. VAR
  3875.   ch : CHAR;
  3876.  
  3877. BEGIN
  3878.  
  3879.   WNew( 5,2,20,7, WHITE,BLUE,WHITE,BLUE, 'Window' );
  3880.  
  3881.   WriteLn( 'Press any key to Exit this Window...' );
  3882.   ch := WReadKey;
  3883.  
  3884.   WExit;
  3885.  
  3886.   WMessage( 'Press any key to return to the Window...', WHITE, CYAN );
  3887.   ch := WReadKey;
  3888.   WGo( 'Window' );
  3889.  
  3890.   WMessage( 'Press any key to Quit', WHITE, CYAN );
  3891.   WriteLn( 'Press any key to Quit...' );
  3892.   ch := WReadKey;
  3893.  
  3894.   WDispose( 'Window' );
  3895.  
  3896. END;
  3897.  
  3898.  
  3899. ──────────────────────────────────────────────────────────────────────────────
  3900.  
  3901.  
  3902. [FUNCTION]
  3903.  
  3904. Procedure WGo(                    Name           : ST80         );
  3905.  
  3906. [PARAMETERS]
  3907.  
  3908. Name        Name of Window to make Active/Update
  3909.  
  3910. [RETURNS]
  3911.  
  3912. (None)
  3913.  
  3914. [DESCRIPTION]
  3915.  
  3916. This function makes the given Window Name the Active Window.
  3917.  
  3918. NOTE: This function is intended for future use to allow the user to
  3919. call up any window as the active window.  However currently it's use
  3920. is limited to simply making Window Border Frame modifications on the
  3921. current window to update and be displayed.
  3922.  
  3923. [SEE-ALSO]
  3924.  
  3925. WNew
  3926. WEnter
  3927. WExit
  3928. WDispose
  3929.  
  3930. [EXAMPLE]
  3931.  
  3932. VAR
  3933.   ch : CHAR;
  3934.  
  3935. BEGIN
  3936.  
  3937.   WNew(  5, 2,20, 7, WHITE,BLUE,WHITE,BLUE, 'Window 1' );
  3938.   WNew( 40,15,60,20, WHITE,CYAN,WHITE,CYAN, 'Window 2' );
  3939.  
  3940.   WriteLn( 'Press any key to Go to Window 1...' );
  3941.   WMessage( 'Press any key to Go to Window 1', WHITE, CYAN );
  3942.   ch := WReadKey;
  3943.   WGo( 'Window 1' );
  3944.  
  3945.   WriteLn( 'Press any key to Go to Window 2...' );
  3946.   WMessage( 'Press any key to Go to Window 2', WHITE, BLUE );
  3947.   ch := WReadKey;
  3948.   WGo( 'Window 2' );
  3949.  
  3950.   WriteLn;
  3951.   WriteLn( 'Press any key to Quit...' );
  3952.   WMessage( 'Press any key to Quit', WHITE, CYAN );
  3953.   ch := WReadKey;
  3954.  
  3955.   WDispose( 'Window 2' );
  3956.   WDispose( 'Window 1' );
  3957.  
  3958. END;
  3959.  
  3960.  
  3961. ──────────────────────────────────────────────────────────────────────────────
  3962.  
  3963.  
  3964. [FUNCTION]
  3965.  
  3966. Procedure WDispose(               Name           : ST80         );
  3967.  
  3968. [PARAMETERS]
  3969.  
  3970. Name        Name of Window to Dispose of
  3971.  
  3972. [RETURNS]
  3973.  
  3974. (None)
  3975.  
  3976. [DESCRIPTION]
  3977.  
  3978. This function disposes (destroys) the Window of the given Name
  3979.  
  3980. [SEE-ALSO]
  3981.  
  3982. WNew
  3983. WEnter
  3984. WExit
  3985. WGo
  3986.  
  3987. [EXAMPLE]
  3988.  
  3989. BEGIN
  3990.  
  3991.  WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE, 'Window' );
  3992.  
  3993.  WriteLn( 'Press any Key to Dispose of this Window...' );
  3994.  
  3995.  While NOT WKeyPressed Do;
  3996.  
  3997.  WDispose( 'Window' );
  3998.  
  3999. END;
  4000.  
  4001.  
  4002. ──────────────────────────────────────────────────────────────────────────────
  4003.  
  4004.  
  4005. [FUNCTION]
  4006.  
  4007. Procedure WTSR_Entry;
  4008.  
  4009. [PARAMETERS]
  4010.  
  4011. (None)
  4012.  
  4013. [RETURNS]
  4014.  
  4015. (None)
  4016.  
  4017. [DESCRIPTION]
  4018.  
  4019. If the program being Created is a TSR, then this function call MUST
  4020. be the first thing it does upon entry.
  4021.  
  4022. This function is to be called each time a TSR Program is popped-up.
  4023. It reads and resets all the window and screen information so that
  4024. the program can continue normally without having to worry about screen
  4025. display changes.
  4026.  
  4027. It is particularly useful for instances where the Screen MODE has been
  4028. altered!
  4029.  
  4030. [SEE-ALSO]
  4031.  
  4032. [EXAMPLE]
  4033.  
  4034. BEGIN
  4035.  
  4036.   WTSR_Entry;
  4037.  
  4038.   { Now continue with the rest of the program as normal }
  4039. END;
  4040.  
  4041.  
  4042. ──────────────────────────────────────────────────────────────────────────────
  4043.  
  4044.  
  4045. [FUNCTION]
  4046.  
  4047. Function  WGetWinPointer(         Name           : ST80         ) : THandle;
  4048.  
  4049. [PARAMETERS]
  4050.  
  4051. [RETURNS]
  4052.  
  4053. [DESCRIPTION]
  4054.  
  4055. [SEE-ALSO]
  4056.  
  4057. [EXAMPLE]
  4058.  
  4059.  
  4060. ──────────────────────────────────────────────────────────────────────────────
  4061.  
  4062.  
  4063. [FUNCTION]
  4064.  
  4065. Procedure WSetHasShadow(          Name           : ST80;
  4066.                                   Bool           : BOOLEAN      );
  4067.  
  4068. [PARAMETERS]
  4069.  
  4070. Name        Window Name to put or remove Shadow from
  4071. Bool        Is this to Put a Shadow on the Window?
  4072.  
  4073. [RETURNS]
  4074.  
  4075. (None)
  4076.  
  4077. [DESCRIPTION]
  4078.  
  4079. Sets or Unsets the "HasShadow" Flag in the indicated Window's Definition
  4080. Structure.  Now anytime this window is active, if the Flag is TRUE then
  4081. a shadow will be drawn below this window, otherwise no shadows will be
  4082. drawn.
  4083.  
  4084. [SEE-ALSO]
  4085.  
  4086. WDrawShadowOn
  4087. WEraseShadowFrom
  4088.  
  4089. [EXAMPLE]
  4090.  
  4091. BEGIN
  4092.  
  4093.   WNew( 5,2,20,7, WHITE,BLUE,WHITE,BLUE, 'Window' );
  4094.  
  4095.   WSetHasShadow( 'Window' );
  4096.   WriteLn( 'This Window has NO Shadow' );
  4097.   WriteLn( 'Press a key to add one...' );
  4098.  
  4099.   While NOT WKeyPressed Do;
  4100.   WriteLn;
  4101.   WriteLn(
  4102.  
  4103.   WSetHasShadow( 'Window', TRUE );
  4104.   WriteLn( 'Now this Window has a Shadow' );
  4105.   WriteLn( 'Press ESC to Quit...');
  4106.  
  4107.   While WReadKey <> #27 Do;
  4108.  
  4109.   WDispose( 'Window' );
  4110.  
  4111. END;
  4112.  
  4113.  
  4114. ──────────────────────────────────────────────────────────────────────────────
  4115.  
  4116.  
  4117. [FUNCTION]
  4118.  
  4119. Procedure WDoBoxFrame(            TheWin         : PWin         );
  4120.  
  4121. [PARAMETERS]
  4122.  
  4123. TheWin      Pointer to Window Definition Structure
  4124.  
  4125. [RETURNS]
  4126.  
  4127. (None)
  4128.  
  4129. [DESCRIPTION]
  4130.  
  4131. Updates the BoxFrame of the Window indicated by the provided
  4132. Window Definition Structure.
  4133.  
  4134. [SEE-ALSO]
  4135.  
  4136. [EXAMPLE]
  4137.  
  4138.  
  4139. ──────────────────────────────────────────────────────────────────────────────
  4140.  
  4141.  
  4142. [FUNCTION]
  4143.  
  4144. Procedure WSubmitFrameJoint(      Num            : INTEGER;
  4145.                                   Side           : INTEGER;
  4146.                                   Offset         : INTEGER      );
  4147.  
  4148. [PARAMETERS]
  4149.  
  4150. Num         A Sequential Frame Joint Number.Frame Type
  4151. Side        Frame Side and Type Number
  4152. (1-4 Single on Side, 11-14 Double on Side (1=Left,2=Right,3=Bottom,4=Top)
  4153. Offset      Position from the Upper or Right Corner (base=0)
  4154. [RETURNS]
  4155.  
  4156. [DESCRIPTION]
  4157.  
  4158. Submits a Frame Joint (the intersection point of a Window Frame with
  4159. an inner window line drawing character).  This is used the make lines
  4160. drawn within the window to be contiguous with the frame.
  4161.  
  4162. A Frame Joint Number is simply an arbitrarily assign number starting
  4163. at 1 for the First Frame Joint and running Sequentially upwards from
  4164. there to the total number of Frame Joints to Add.  Joints should be
  4165. Submitted Sequentially in order.
  4166.  
  4167. The Side not only represents the Side but also whether the internal end
  4168. of the joint is a Single- or Double-Line Type.  To Indicate all this
  4169. information use the following values:
  4170.  
  4171.       Side      Single     Double
  4172.       -------   --------   ---------
  4173.       Top          1         11
  4174.       Left         2         12
  4175.       Bottom       3         13
  4176.       Right        4         14
  4177.  
  4178. And the Position is the Number of Characters that place is from the
  4179. Character on the Top or Left most Joint.  The Corner Character is
  4180. counted as 0 with the 1st Character inside the Window being 1, ...
  4181.  
  4182. NOTE: These Frame Joints are NOT visible until the frame is updated
  4183. thru a call to WGoCurrentWin (or other Frame updating function).
  4184.  
  4185. [SEE-ALSO]
  4186.  
  4187. [EXAMPLE]
  4188.  
  4189. BEGIN
  4190.  
  4191.   WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE, 'Window' );
  4192.  
  4193.   WSubmitFrameJoint( 1, 1, 3 ); { 1st Joint, Top/Single, at 3rd Win Column }
  4194.   WSubmitFrameJoint( 2, 3, 3 ); { 2nd Joint, Bottom/Single, 3rd Win Column }
  4195.  
  4196.   WriteLn( 'Ready to Update Current Window Frame.' );
  4197.   WriteLn( 'Press any Key to do so...' );
  4198.  
  4199.   While NOT WKeyPressed Do;
  4200.  
  4201.   WGoCurrentWin;
  4202.  
  4203.   WriteLn;
  4204.   WriteLn( 'Press ESC to Quit...' );
  4205.  
  4206.   While WReadKey = #27 Do;
  4207.  
  4208.   WDispose( 'Window' );
  4209.  
  4210. END;
  4211.  
  4212.  
  4213. ──────────────────────────────────────────────────────────────────────────────
  4214.  
  4215.  
  4216. [FUNCTION]
  4217.  
  4218. Procedure WHideUnHide(            Name           : ST80;
  4219.                                   HideWin        : BOOLEAN      );
  4220.  
  4221. [PARAMETERS]
  4222.  
  4223. Name        Name of Window to Hide or Unhide
  4224. HideWin     Is this to Hide the Window?
  4225.  
  4226. [RETURNS]
  4227.  
  4228. (None)
  4229.  
  4230. [DESCRIPTION]
  4231.  
  4232. This functions Hides or Unhides the Window of the given Name
  4233.  
  4234. [SEE-ALSO]
  4235.  
  4236. WNew
  4237. WEnter
  4238. WExit
  4239. WGo
  4240. WDispose
  4241. WGoCurrentWin
  4242.  
  4243. [EXAMPLE]
  4244.  
  4245. VAR
  4246.   ch : CHAR;
  4247.  
  4248. BEGIN
  4249.  
  4250.   WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE, 'Window' );
  4251.  
  4252.   WMessage( 'Press any key to Hide the Current Window.', WHITE, RED );
  4253.   While NOT WKeyPressed Do;
  4254.   ch := WReadKey;
  4255.  
  4256.   WHideUnhide( 'Window', TRUE );
  4257.  
  4258.   WMessage( 'Press any key to UnHide the Window' );
  4259.   While NOT WKeyPressed Do;
  4260.   ch := WReadKey;
  4261.  
  4262.   WMessage( 'Press ESC to Quit', WHITE, RED );
  4263.   WriteLn( 'Press ESC to Quit...' );
  4264.   While WReadKey = #27 Do;
  4265.  
  4266.   WDispose( 'Window' );
  4267.  
  4268. END;
  4269.  
  4270.  
  4271. ──────────────────────────────────────────────────────────────────────────────
  4272.  
  4273.  
  4274. [FUNCTION]
  4275.  
  4276. Procedure WGoCurrentWin;
  4277.  
  4278. [PARAMETERS]
  4279.  
  4280. (None)
  4281.  
  4282. [RETURNS]
  4283.  
  4284. (None)
  4285.  
  4286. [DESCRIPTION]
  4287.  
  4288. This function makes the given Window Name the Active Window.
  4289. Unlike WGoWin, this function was never intended for anything other
  4290. than to simply update the current window display and borders.
  4291.  
  4292. [SEE-ALSO]
  4293.  
  4294. WNew
  4295. WEnter
  4296. WExit
  4297. WGo
  4298. WDispose
  4299. WHideUnHide
  4300.  
  4301. [EXAMPLE]
  4302.  
  4303. BEGIN
  4304.  
  4305.   WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE, 'Window' );
  4306.  
  4307.   WSubmitFrameJoint( 1, 3, 1 );
  4308.   WSubmitFrameJoint( 3, 3, 1 );
  4309.  
  4310.   WriteLn( 'Ready to Update Current Window Frame.' );
  4311.   WriteLn( 'Press any Key to do so...' );
  4312.  
  4313.   While NOT WKeyPressed Do;
  4314.  
  4315.   WGoCurrentWin;
  4316.  
  4317.   WriteLn;
  4318.   WriteLn( 'Press ESC to Quit...' );
  4319.  
  4320.   While WReadKey = #27 Do;
  4321.  
  4322.   WDispose( 'Window' );
  4323.  
  4324. END;
  4325.  
  4326.  
  4327. ──────────────────────────────────────────────────────────────────────────────
  4328.  
  4329.  
  4330. [FUNCTION]
  4331.  
  4332. Procedure WEraseShadowFrom(       P              : PWin         );
  4333.  
  4334. [PARAMETERS]
  4335.  
  4336. P           Pointer to Window Data Structure
  4337.  
  4338. [RETURNS]
  4339.  
  4340. (None)
  4341.  
  4342. [DESCRIPTION]
  4343.  
  4344. Removes any shadow from the Window using the Pointer to the
  4345. Window's Definition Structure provided.
  4346.  
  4347. [SEE-ALSO]
  4348.  
  4349. WDrawShadowOn
  4350.  
  4351. [EXAMPLE]
  4352.  
  4353.  
  4354. ──────────────────────────────────────────────────────────────────────────────
  4355.  
  4356.  
  4357. [FUNCTION]
  4358.  
  4359. Procedure WDrawShadowOn(          P              : PWin         );
  4360.  
  4361. [PARAMETERS]
  4362.  
  4363. P           Pointer to Window Data Structure
  4364.  
  4365. [RETURNS]
  4366.  
  4367. (None)
  4368.  
  4369. [DESCRIPTION]
  4370.  
  4371. Activates and draws a shadow on the Window using the Pointer
  4372. to the Window's Definition Structure provided.
  4373.  
  4374. [SEE-ALSO]
  4375.  
  4376. WEraseShadowFrom
  4377.  
  4378. [EXAMPLE]
  4379.  
  4380.  
  4381. ──────────────────────────────────────────────────────────────────────────────
  4382.  
  4383.  
  4384. [FUNCTION]
  4385.  
  4386. Procedure WFlushKeyBuf;
  4387.  
  4388. [PARAMETERS]
  4389.  
  4390. (None)
  4391.  
  4392. [RETURNS]
  4393.  
  4394. (None)
  4395.  
  4396. [DESCRIPTION]
  4397.  
  4398. This Function not only deletes all Keys stored in the Window Key Buffer
  4399. but also flushes the Keyboard Buffer.
  4400.  
  4401. [SEE-ALSO]
  4402.  
  4403. WKeyPressed
  4404. WIDoReadKey
  4405.  
  4406. [EXAMPLE]
  4407.  
  4408.  
  4409. ──────────────────────────────────────────────────────────────────────────────
  4410.  
  4411.  
  4412. [FUNCTION]
  4413.  
  4414. Procedure WRename(                OrigName       : ST80;
  4415.                                   NewName        : ST80         );
  4416.  
  4417. [PARAMETERS]
  4418.  
  4419. OrigName    Original Name of Window
  4420. NewName     New Name for Window
  4421.  
  4422. [RETURNS]
  4423.  
  4424. (None)
  4425.  
  4426. [DESCRIPTION]
  4427.  
  4428. This function renames the Original Window to the provided New Name
  4429.  
  4430. [SEE-ALSO]
  4431.  
  4432. (None)
  4433.  
  4434. [EXAMPLE]
  4435.  
  4436. BEGIN
  4437.  
  4438.   WNew( 5, 2, 20, 7, WHITE, BLUE, WHITE, BLUE, 'Window' );
  4439.  
  4440.   WReName( 'Window', 'New Name' );
  4441.  
  4442.   While NOT WKeyPressed DO;
  4443.  
  4444.   WDispose( 'New Name' );
  4445.  
  4446. END;
  4447.  
  4448.  
  4449. ──────────────────────────────────────────────────────────────────────────────
  4450.  
  4451.  
  4452. [FUNCTION]
  4453.  
  4454. Procedure WLoadWidgetFont;
  4455.  
  4456. [PARAMETERS]
  4457.  
  4458. (None)
  4459.  
  4460. [RETURNS]
  4461.  
  4462. (None)
  4463.  
  4464. [DESCRIPTION]
  4465.  
  4466. Loads the Widget Fonts.  These contain a whole host of drawings including
  4467. Checkboxes with real checks in them, Circular Radio Buttons, and a bunch
  4468. of Drawings representing Drives of various sorts.
  4469.  
  4470. [SEE-ALSO]
  4471.  
  4472. WLoadLook1BorderFont
  4473.  
  4474. [EXAMPLE]
  4475.  
  4476. BEGIN
  4477.  
  4478.   WLoadWidgetFont;
  4479.  
  4480.   { Now Checkboxes look like "real" checkboxes (square with "x" in middle) }
  4481.  
  4482. END;
  4483.  
  4484.  
  4485. ──────────────────────────────────────────────────────────────────────────────
  4486.  
  4487.  
  4488. [FUNCTION]
  4489.  
  4490. Procedure WLoadLook1BorderFont;
  4491.  
  4492. [PARAMETERS]
  4493.  
  4494. (None)
  4495.  
  4496. [RETURNS]
  4497.  
  4498. (None)
  4499.  
  4500. [DESCRIPTION]
  4501.  
  4502. Loads the Border Fonts so that Window Borders will be a colored line
  4503. extending up to the very edge of the window boundary.
  4504.  
  4505. Looks very slick!
  4506.  
  4507. [SEE-ALSO]
  4508.  
  4509. WLoadWidgetFont
  4510.  
  4511. [EXAMPLE]
  4512.  
  4513.  
  4514. ──────────────────────────────────────────────────────────────────────────────
  4515.  
  4516.  
  4517. [FUNCTION]
  4518.  
  4519. Procedure WSetPalette(            PalNum, R, G, B : BYTE        );
  4520.  
  4521. [PARAMETERS]
  4522.  
  4523. PalNum      Palette Entry Number to Modify
  4524. R           New Red Color Entry for Palette
  4525. G           New Green Color Entry for Palette
  4526. B           New Blue Color Entry for Palette
  4527.  
  4528. [RETURNS]
  4529.  
  4530. (None)
  4531.  
  4532. [DESCRIPTION]
  4533.  
  4534. Writes the indicated VGA Color Palette Entry to the new RGB colors.
  4535.  
  4536. [SEE-ALSO]
  4537.  
  4538. WGetPalette
  4539. WLoadBlueGrayPalette
  4540. WLoadGreenGrayPalette
  4541.  
  4542. [EXAMPLE]
  4543.  
  4544. BEGIN
  4545.  
  4546.   WSetPalette( 6, 1, 2, 3 );
  4547.  
  4548.   { For Palette #6, sets Red=1, Green=2, Blue=3 }
  4549.  
  4550. END;
  4551.  
  4552.  
  4553. ──────────────────────────────────────────────────────────────────────────────
  4554.  
  4555.  
  4556. [FUNCTION]
  4557.  
  4558. Procedure WGetPalette(            PalNum         : BYTE;
  4559.                               Var R,G,B          : BYTE         );
  4560.  
  4561. [PARAMETERS]
  4562.  
  4563. PalNum      Palette Entry Number to Read
  4564. R           VAR Returned Red Color Entry of Palette
  4565. G           VAR Returned Green Color Entry of Palette
  4566. B           VAR Returned Blue Color Entry of Palette
  4567.  
  4568. [RETURNS]
  4569.  
  4570. (None)
  4571.  
  4572. [DESCRIPTION]
  4573.  
  4574. Reads the indicated VGA Color Palette Entry to obtain the current
  4575. RGB colors for that Palette Entry
  4576.  
  4577. [SEE-ALSO]
  4578.  
  4579. WSetPalette
  4580. WLoadBlueGrayPalette
  4581. WLoadGreenGrayPalette
  4582.  
  4583. [EXAMPLE]
  4584.  
  4585. VAR
  4586.   R,G,B : BYTE;
  4587.  
  4588. BEGIN
  4589.  
  4590.   WGetPalette( 6, R, G, B );
  4591.  
  4592.   WriteLn( 'Red   = ', R );
  4593.   WriteLn( 'Green = ', G );
  4594.   WriteLn( 'Blue  = ', B );
  4595.  
  4596. END;
  4597.  
  4598.  
  4599. ──────────────────────────────────────────────────────────────────────────────
  4600.  
  4601.  
  4602. [FUNCTION]
  4603.  
  4604. Procedure WLoadBlueGrayPalette;
  4605.  
  4606. [PARAMETERS]
  4607.  
  4608. (None)
  4609.  
  4610. [RETURNS]
  4611.  
  4612. (None)
  4613.  
  4614. [DESCRIPTION]
  4615.  
  4616. Loads the VGA Blue/Gray Color Palette.  All display colors altered
  4617. hereafter by this palette colors.
  4618.  
  4619. [SEE-ALSO]
  4620.  
  4621. WSetPalette
  4622. WGetPalette
  4623. WLoadGreenGrayPalette
  4624.  
  4625. [EXAMPLE]
  4626.  
  4627. VAR
  4628.   I : INTEGER;
  4629.  
  4630. BEGIN
  4631.  
  4632.   For i := 0 to 15 Do
  4633.   BEGIN
  4634.     TextColor( i );
  4635.     Write( 'X' );
  4636.   END;
  4637.  
  4638.   WLoadBlueGrayPalette;
  4639.  
  4640.   For i := 0 to 15 Do
  4641.   BEGIN
  4642.     TextColor( i );
  4643.     Write( 'X' );
  4644.   END;
  4645.  
  4646. END;
  4647.  
  4648.  
  4649. ──────────────────────────────────────────────────────────────────────────────
  4650.  
  4651.  
  4652. [FUNCTION]
  4653.  
  4654. Procedure WLoadGreenGrayPalette;
  4655.  
  4656. [PARAMETERS]
  4657.  
  4658. (None)
  4659.  
  4660. [RETURNS]
  4661.  
  4662. (None)
  4663.  
  4664. [DESCRIPTION]
  4665.  
  4666. Loads the VGA Green/Gray Color Palette.  All display colors altered
  4667. hereafter by this palette colors.
  4668.  
  4669. [SEE-ALSO]
  4670.  
  4671. WSetPalette
  4672. WGetPalette
  4673. WLoadBlueGrayPalette
  4674.  
  4675. [EXAMPLE]
  4676.  
  4677. VAR
  4678.   I : INTEGER;
  4679.  
  4680. BEGIN
  4681.  
  4682.   For i := 0 to 15 Do
  4683.   BEGIN
  4684.     TextColor( i );
  4685.     Write( 'X' );
  4686.   END;
  4687.  
  4688.   WLoadGreeGrayPalette;
  4689.  
  4690.   For i := 0 to 15 Do
  4691.   BEGIN
  4692.     TextColor( i );
  4693.     Write( 'X' );
  4694.   END;
  4695.  
  4696. END;
  4697.  
  4698.  
  4699. ──────────────────────────────────────────────────────────────────────────────
  4700.  
  4701.  
  4702. [FUNCTION]
  4703.  
  4704. Procedure WDrawBox(               X,Y,X2,Y2,F,B,Style : INTEGER );
  4705.  
  4706. [PARAMETERS]
  4707.  
  4708. X           Left Screen Coordinate of Window Frame
  4709. Y           Upper Screen Coordinate of Window Frame
  4710. X2          Right Screen Coordinate of Window Frame
  4711. Y2          Bottom Screen Coordinate of Window Frame
  4712. F           Foreground Color to Draw Frame with
  4713. B           Background Color to Draw Frame with
  4714. Style       Window Frame Style to use
  4715.               As follows:
  4716.                 1 = ""
  4717.                 2 = ""
  4718.                 3 = ""
  4719.                 4 = ""
  4720.  
  4721. [RETURNS]
  4722.  
  4723. (None)
  4724.  
  4725. [DESCRIPTION]
  4726.  
  4727. This routine Draws a Window Box Frame using the provided Window
  4728. Coordinates, Text Foreground and Background colors, and using the
  4729. given Border Style.
  4730.  
  4731. [SEE-ALSO]
  4732.  
  4733. WBox
  4734.  
  4735. [EXAMPLE]
  4736.  
  4737. BEGIN
  4738.  
  4739.   WDrawBox( 5,2, 20, 7, WHITE, BLUE );
  4740.  
  4741.   {---------------------------------------------------}
  4742.   { Draws a Box with the coordinates of 5,2 and 20,7  }
  4743.   { with the Foreground = WHITE and Background = BLUE }
  4744.   {---------------------------------------------------}
  4745.  
  4746. END;
  4747.  
  4748.  
  4749. ──────────────────────────────────────────────────────────────────────────────
  4750.  
  4751.  
  4752. [FUNCTION]
  4753.  
  4754. Procedure WBox(                   X, Y, X2, Y2, STYLE : INTEGER );
  4755.  
  4756. [PARAMETERS]
  4757.  
  4758. X           Left Screen Coordinate of Window Frame
  4759. Y           Upper Screen Coordinate of Window Frame
  4760. X2          Right Screen Coordinate of Window Frame
  4761. Y2          Bottom Screen Coordinate of Window Frame
  4762. Style       Window Frame Style to use
  4763.               As follows:
  4764.                 1 = ""
  4765.                 2 = ""
  4766.                 3 = ""
  4767.                 4 = ""
  4768.  
  4769. [RETURNS]
  4770.  
  4771. (None)
  4772.  
  4773. [DESCRIPTION]
  4774.  
  4775. This routine Draws a Window Box Frame in the current colors using
  4776. the provided Window Coordinates and the given Border Style.
  4777.  
  4778. [SEE-ALSO]
  4779.  
  4780. WDrawBox
  4781.  
  4782. [EXAMPLE]
  4783.  
  4784. BEGIN
  4785.  
  4786.   WBox( 5,2, 20, 7, 3 );
  4787.  
  4788.   { Draws a Box Frame with the coordinates of 5,2 and 20,7 using Sytle #3 }
  4789.  
  4790. END;
  4791.  
  4792.  
  4793. ──────────────────────────────────────────────────────────────────────────────
  4794.  
  4795.  
  4796. [FUNCTION]
  4797.  
  4798. Procedure WEventsOn;
  4799.  
  4800. [PARAMETERS]
  4801.  
  4802. (None)
  4803.  
  4804. [RETURNS]
  4805.  
  4806. (None)
  4807.  
  4808. [DESCRIPTION]
  4809.  
  4810. Turns on EVENTS Handling in the Window Environment.
  4811.  
  4812. [SEE-ALSO]
  4813.  
  4814. WEventsOff
  4815.  
  4816. [EXAMPLE]
  4817.  
  4818. BEGIN
  4819.  
  4820.   WEventsOn;
  4821.  
  4822. END;
  4823.  
  4824.  
  4825. ──────────────────────────────────────────────────────────────────────────────
  4826.  
  4827.  
  4828. [FUNCTION]
  4829.  
  4830. Procedure WEventsOff;
  4831.  
  4832. [PARAMETERS]
  4833.  
  4834. (None)
  4835.  
  4836. [RETURNS]
  4837.  
  4838. (None)
  4839.  
  4840. [DESCRIPTION]
  4841.  
  4842. Turns off EVENTS handling in the Window Environment.
  4843.  
  4844. [SEE-ALSO]
  4845.  
  4846. WEventsOn
  4847.  
  4848. [EXAMPLE]
  4849.  
  4850. BEGIN
  4851.  
  4852.   WEventsOff;
  4853.  
  4854. END;
  4855.  
  4856.